itch.io is community of indie game creators and players

Devlogs

Figured out how to keep GUI select working

Geogon PolyMetry: The Proof Concept
A downloadable Geogon V-slice Unity for Windows, macOS, Linux, and Android

Previously, on

This video fix GUI selection broken by mouse click. fixed by storing selection and reselect previously selected if it is broken.

But still a problem.

My game has different menu part, clustered by inherited gameObjects.

I know! I have made a method!

//Workaround to get the store selected selects button on newly activated menu part e.g. Menu -> Option
    //Fill it with the selectable Button GameObject!
    public void SetStoreSelected(GameObject newThing)
    {
        StoreSelected = newThing;
        eventSystem.SetSelectedGameObject(StoreSelected);
    }

 Then it will loaded to a button OnClick(), to trigger this method, on LevelLoader.cs in this case.

Now after choosing that method, fill it with the new selectable gameObject on that new menu part. check SampleMenuScene to see it.

Download Geogon PolyMetry: The Proof Concept
Leave a comment