How do I check mystate for previously being a specicfic state and call a different state if mystate was that state?
I am writing a text game and I have many recalls to the same event but would like the event text to change if you already viewed that event once. So my question is how do I get mystate to check if it has been a certain state and choose a different state based on that.
if (myState == States.Dream) { States_Dream (); } else if myState == States.Random) { } States_Random (); this is the current code I am working with Here is an example If myState is currently States.Random I would like it to check myStates for ever being States.Dream and if it has been that before to choose States.Random_1 instead but if not print what States.Random calls for.
I have done several searches for this type of reference and am unable to find anything that calls for history of a state and uses that info. If you can help I would appreciate it.
Thanks
Answer by Taxen0 · Oct 30, 2015 at 07:21 PM
you could add a bool in each state that tracks if the state has been visited. Or a array in the player where you simply add the states that you have visited.
then check if the bool is true / the list contains the state and do something else based on that.
Your answer
Follow this Question
Related Questions
Select a random line of a text file and send it into a Text field 0 Answers
Text is Distorted : Android 1 Answer
How to attach text to moving prefab so that both move together? 1 Answer
How to get Text from TextMeshPro input field 5 Answers
Text Will not disappear after Object Destroyed,Text Wont Go away after object disappears. 1 Answer