- Home /
Question by
pancake · Oct 22, 2012 at 12:07 PM ·
javascriptclassreflectioninstantiation
Is there a way to instantiate a class, when its classtype is stored as a String variable (in unity-javascript)?
This is some pseudo-code to describe what i need:
var classType:String = "MyClass";
var newObject = new InstanceOfType(classType);
Debug.Log(newObject); //console output: MyClass
Comment
Your answer
Follow this Question
Related Questions
UnityScript - Class reference 1 Answer
Can't create custom class in js? 1 Answer
How to access var in other class using string 0 Answers
How can I declare class properties of an object in a single line? 2 Answers
unityscript class + array problem 2 Answers