Consider these pseudo-pseudocode examples;
- If the mouse is over an interactive object AND my “DoStuff” input axis is pressed, then interact with the object.
- But if the mouse is NOT over an interactive object AND the “DoStuff” input axis is pressed, then enter the “NonInteractiveMode” state.
- If we are in the “NonInteractiveMode” state, then dont even bother with the first 2 “if” tests and instead test some other tree of ifs.
…
I have lots of such kind of complex combinations of input axes and lots of nested if/else situations to handle in my project.
What is the intended use of Unity; is there some built in feature in Unity that can handle this complexity for me? Or do I need to create my own InputHandler / StateManager game objects and have them keep track of input states and nested input situation? Or is there some other solution how this kind of problem is usually solved?