// Use this for initialization void Start() { controllerScript = this.GetComponent <Controller>(); pathPercent = controllerScript.PathToStop; mainStopPoints.Add(98); jungleCommandoScript0 = (JungleCommandoScript)enemiesFirstStop[0].GetComponent(typeof(JungleCommandoScript)); jungleCommandoScript1 = (JungleCommandoScript)enemiesFirstStop[1].GetComponent(typeof(JungleCommandoScript)); typerScript = (TyperHelper)GameObject.Find("MainCamera").GetComponent(typeof(TyperHelper)); }
public void FindScript() { Component tempScript = currentObjects[globalIndex].GetComponent(typeof(MonoBehaviour)); if (tempScript.GetType().Equals(typeof(TerroristScript))) { TerroristScript tempTerrorist = (TerroristScript)currentObjects[globalIndex].GetComponent(typeof(TerroristScript)); tempTerrorist.KillToDeath(); } if (tempScript.GetType().Equals(typeof(JungleCommandoScript))) { JungleCommandoScript tempJungle = (JungleCommandoScript)currentObjects[globalIndex].GetComponent(typeof(JungleCommandoScript)); tempJungle.KillToDeath(); } if (tempScript.GetType().Equals(typeof(ZombieScript))) { ZombieScript tempZombie = (ZombieScript)currentObjects[globalIndex].GetComponent(typeof(ZombieScript)); tempZombie.KillToDeath(); } if (tempScript.GetType().Equals(typeof(LightScript))) { LightScript tempLight = (LightScript)currentObjects[globalIndex].GetComponent(typeof(LightScript)); tempLight.KillToDeath(); } if (tempScript.GetType().Equals(typeof(ArmyScript))) { ArmyScript tempArmy = (ArmyScript)currentObjects[globalIndex].GetComponent(typeof(ArmyScript)); tempArmy.KillToDeath(); } if (tempScript.GetType().Equals(typeof(MissileScript))) { MissileScript tempMissile = (MissileScript)currentObjects[globalIndex].GetComponent(typeof(MissileScript)); tempMissile.KillToDeath(); } Killed(currentObjects[globalIndex]); }