Figured out how to keep GUI select working


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.

Get Geogon PolyMetry: The Proof Concept

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.