Hello
My gameobject’s are subscribed to an event that when called, passes the gameobject to a static method which takes care of disabling and hiding that gameobject. The static method also adds that gameobject to a list so I can keep track of the disabled gameobjects.
My question is when I call this static method on multiple objects at the same time.
-
How is the order to which they are added to the list decided?
-
Is a list the best way to keep track of them?
I’m thinking about storing the transform of the gameobject before it is disabled, so when I come to enable it I can set it back to it’s previous position.
I will add that I haven’t use static methods or variables often, but I would like to be able to see the list of gameobjects in the inspector. Since the method is static I made the list static, from my understanding of static variables that would make sense as I don’t need multiple instances of this class( correct? ), but static variables don’t show up in the inspector.
- Should I make them non-static and create an instance of the class at start time?
Thanks