void GameOver() { DeathZoneScript deathscript = GameObject.Find("DeathZone").GetComponent <DeathZoneScript>(); if (isPicking == false && fuelLevel <= 0) { gameover = true; } }
void DeathZone() { GameObject obj = new GameObject("DeathZone"); obj.tag = "Deathzone"; BoxCollider2D bc = obj.AddComponent <BoxCollider2D> (); bc.size = new Vector2(1f, 20f); DeathZoneScript dzs = obj.AddComponent <DeathZoneScript> (); dzs.target = transform; }
// Use this for initialization private void Awake() { deathscript = gameObject.GetComponentInParent <DeathZoneScript>(); }