|
Post by dewm3734 on Jan 26, 2021 5:58:11 GMT
Hi, awesome tutorial, thank you very much for directing me to this forum. I would like some help making some modifications to these scripts if that’s ok. I would like it if the movement option was a button instead of one of the options in the list. This way the player could enter the movement state from any of the menu states instead of backing out of the current menu state to the command selection state to do so. However, I am having trouble implementing this the way it is currently structured.
My first iteration was to simply add a button, but because it is not an abilityMenuEntry object it is not apart of the menuEntries list and so you cannot scroll to it using keyboard functionality.
My second implementation was to try and create a second variant of the abilityMenuEntry object but the GameObjectPoolController only takes one prefab. This also means that if I made the abilityMenuEntry class a base class for two varying ability menu entries then I would be able to add both different types of menu entries but I would only be able to pass the prefab for one.
Lastly, I would be ok with making it a button but it then become the only action that requires a mouse click as opposed to both a mouse click or keyboard input.
Any help would be appreciated.
|
|
|
Post by dewm3734 on Jan 28, 2021 7:06:50 GMT
So, I figured it out, kind of. it all functions as it should the only issue at this point is the UI. Ideally I would like this menuOption to be next the the title int the menu, however I can only move it horizontally and not vertically. If anyone knows of any good tutorials on Horizontal and Vertical Layout Groups let me know .
|
|
|
Post by Admin on Feb 16, 2021 14:17:42 GMT
I'm not sure about tutorials specific to those components (though I bet there are plenty out there), but for starters if you look at the hierarchy of the "Ability Menu Controller"'s child, "Ability Menu Panel", you can see it using the Vertical Layout Group component. You can also look at the grandchild, "Header", or any of the "Ability Menu Entry" rows for an example of the Horizontal Layout Group.
Basic setup: You just create a parent/child with Rect Transform on each. They could be GameObject -> UI -> Panel for example. Add the Type of Layout Group component that you want to the Parent, and then it will automatically layout the children based on the settings you provide.
|
|