// Use this for initialization void Awake () { Assert.IsTrue(spawnPositions.Length != 0); SuperGoal1 = Instantiate(SuperGoalPrefab).GetComponent<SuperGoal>(); SuperGoal2 = Instantiate(SuperGoalPrefab).GetComponent<SuperGoal>(); SuperGoal1.mirror = SuperGoal2; SuperGoal2.mirror = SuperGoal1; sfx = GetComponent<AudioSource>(); }
void spawnSuperGoals(int spawnPointIndex) { SuperGoal1 = Instantiate(SuperGoalPrefab).GetComponent <SuperGoal>(); SuperGoal2 = Instantiate(SuperGoalPrefab).GetComponent <SuperGoal>(); SuperGoal1.mirror = SuperGoal2; SuperGoal2.mirror = SuperGoal1; SuperGoal1.Spawner = this; SuperGoal2.Spawner = this; SuperGoal1.transform.SetParent(spawnPositions[spawnPointIndex], false); SuperGoal2.transform.SetParent(spawnPositions[spawnPointIndex].Find("Mirror"), false); SetGoalsActive(true); Callback.FireAndForget(() => { SetGoalsActive(false); }, superGoalDuration, this); }
void spawnSuperGoals(int spawnPointIndex) { SuperGoal1 = Instantiate(SuperGoalPrefab).GetComponent<SuperGoal>(); SuperGoal2 = Instantiate(SuperGoalPrefab).GetComponent<SuperGoal>(); SuperGoal1.mirror = SuperGoal2; SuperGoal2.mirror = SuperGoal1; SuperGoal1.Spawner = this; SuperGoal2.Spawner = this; SuperGoal1.transform.SetParent(spawnPositions[spawnPointIndex], false); SuperGoal2.transform.SetParent(spawnPositions[spawnPointIndex].Find("Mirror"), false); SetGoalsActive(true); Callback.FireAndForget(() => { SetGoalsActive(false); }, superGoalDuration, this); }