- Home /
Get static variable with GetType
Hey, I have Interaction subclass system with events like public virtual OnInteractionStart() etc. In each interaction subclass, I have public static new bool Requirements. In each object I have List with interaction subclass names. Is there direct way to access static variable with gettype? I have this, but it's really ugly. I need it for dropdown menu, like show InsertKey interaction only if I holds a key.
Interaction intr = AddComponent<Type.GetType(interactions[I])>();
bool r = intr.Requirements();
Destroy(intr);
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Passing unknown parameter type and class inheritance (C#)? 1 Answer
C# Going Static or Going OOP 3 Answers
Can't Encode MD5 2 Answers