void OnTriggerEnter(Collider other) { if (other.tag == "Feet") { GameObject.FindWithTag("Score").GetComponent <HighScore> ().increaseScore(100); } if (other.transform.parent.tag == "Player") { GameObject.FindWithTag("GreenSound").GetComponent <AudioSource> ().Play(); List <GameObject> AllEnemies = new List <GameObject> (); AllEnemies.AddRange(GameObject.FindGameObjectsWithTag("RedBall")); Debug.Log("Enemy array size: " + AllEnemies.Count); foreach (GameObject enemy in AllEnemies) { enemy.GetComponent <BallEnemy> ().StartFreeze(); } CoilyScript coilyScript = GameObject.FindGameObjectWithTag("Coily").GetComponent <CoilyScript> (); if (coilyScript != null) { coilyScript.StartFreeze(); } Destroy(gameObject); } }
public override void StartScript(CubeObjectScript Cube) { if (coily == null) { coily = this; } else if (coily != this) { Destroy(gameObject); } base.StartScript(Cube); qbert = GameObject.FindGameObjectWithTag("Player").GetComponent <QbertScript>(); CoilyMesh = GameObject.FindGameObjectWithTag("CoilyMesh"); destinationCube = qbert.CurrentCube; BFS(currentCube, qbert.CurrentCube); StartCoroutine(Routine()); }
public void DestroyAnimation() { CoilyScript.Move(); Destroy(gameObject); }