public QuaternionFactory(QuaternionType type) { switch (type) { case QuaternionType.Unity: constructor = new UnityConstructor(); break; case QuaternionType.Artemis: constructor = new ArtemisConstructor(); break; default: throw new System.ArgumentException(); } }
void Start() { ConstructorExampleObject myObject = UnityConstructor.Construct <ConstructorExampleObject>(myPrefab, "First", 0); Debug.Log(myObject); myObject = UnityConstructor.Construct <ConstructorExampleObject>(myPrefab, Vector3.one, Quaternion.Euler(90, 90, 0), "Second", 1); Debug.Log(myObject); myObject = GameObjectBuilder.Instance.ThisObject(myPrefab) .At(Vector3.one) .WithName("Third") .Build <ConstructorExampleObject>("Third", 2); Debug.Log(myObject); }