void Start() { EventManager.resetObjects += Reset; Test1 = gameObject.AddComponent <ObjectCreationExtras> (); StartCoroutine(Starting()); }
ObjectCreationExtras CreateNewObjectSpawner(GameObject ObjectToSpawn) { NumberOfSpawners++; GameObject TempGameObject = new GameObject("ObjectCreator - " + NumberOfSpawners); ObjectCreationExtras TempScript = TempGameObject.AddComponent <ObjectCreationExtras> (); TempScript.SetProjectile(0, ObjectToSpawn); return(TempScript); }
void Awake() { // PUT PRECALCULATION AND SETUP STUFF HERE Color Color_1 = Color.blue; Color_1.a = 0.90f; Color Color_2 = Color.red; Color_2.a = 0.90f; Color Color_3 = Color.yellow; Color_3.a = 0.90f; Color Color_4 = Color.white; Color_4.a = 0.90f; Pikachu_Left_Starting = Pikachu_Left.transform.position; Pikachu_Right_Starting = Pikachu_Right.transform.position; Spawner_Main = gameObject.AddComponent <ObjectCreationExtras> (); Spawner_Main.SetProjectile(0, BackGroundEffect1); Spawner_Main.SetColor(0, Color.white); Spawner1 = CreateNewObjectSpawner(ObjectToSpawn); Spawner1.SetColor(0, Color_1); Spawner2 = CreateNewObjectSpawner(ObjectToSpawn); Spawner2.SetColor(0, Color_2); Spawner3 = CreateNewObjectSpawner(ObjectToSpawn); Spawner3.SetColor(0, Color_3); Spawner4 = CreateNewObjectSpawner(ObjectToSpawn); Spawner4.SetColor(0, Color_4); }