Open PCRedHot opened 1 year ago
Same problem, very horrible if there are more buttons
WOW! Acutally you have used it in your code!
But this is not a dictionary :) https://github.com/saraaaaras/Redo-YYY-New/blob/7d2da933fc6a144d62eb12a0f94cc54c3e474cad/Assets/Inport/script/GameEngine.cs#L117
https://github.com/saraaaaras/Redo-YYY-New/blob/7d2da933fc6a144d62eb12a0f94cc54c3e474cad/Assets/Inport/script/GameEngine.cs#L143-L163
This one I know you could not do it the right way, cuz its a hard one. But its time to take a look at more 'advanced' syntax. Here, you can create local function / delegate + dynamically assign listener to the Button. Dragging in unity's inspector is easy and fun, but also very limiting (given you don't want to touch the UnityEditor module which is very hard for you)