Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

0

Bad solution: Add to ScriptableObject public field of type Canvas (better - private field with public setter). On Monobehaviour's Awake() write current canvas' reference to ScriptableObject. Now you can call canvas from ScriptableObject! Any new canvas on Awake() automatically overwrites reference to itself so you always get actual canvas. Kinda bad ...


0

You can tag the Canvas (for example with the tag "Menu") and then in your scriptable object do a GameObject.FindGameObjectWithTag("Menu") and then you can call the method via GetComponent<...>().OpenCraftingPanel()


1

The layout options will change the anchor points of a Control, and you can resize a TextureRect by setting expand to true. You can demonstrate this to yourself: Start a new project Create a Control Add a TextureRect as the child Set the included "icon.png" as the texture Set expand=true Click Layout > Full Rect Note that the Anchors are now set to (0, 0,...


1

This is due to your Canvas scaling properties. By default the Canvas that you use doesn't scale with the resolution. So if you work in Unity with a small resolution (your game window size defines the resolution you're using, in your case it's a 4:3 ratio resolution but it seems very small), let's say 640x480 and try to play the game after building it on a ...


Top 50 recent answers are included