void SetupLevel() { SolarSystemGenerator.Instance.GenerateLevel(); GunController.Instance.Setup(); this.planets = new List <PlanetBehavior>(FindObjectsOfType <PlanetBehavior>()); this.star = GameObject.FindGameObjectWithTag("Star").GetComponent <LifeBehaviour>(); }
public void suicide() { livesLeft--; LifeBehaviour b = lives [(lives.Count - livesLeft) - 1].GetComponent <LifeBehaviour> (); b.death(); }
private void OnCollisionEnter2D(Collision2D other) { if (other.transform != father) { LifeBehaviour f = other.gameObject.GetComponent <LifeBehaviour>(); if (f != null) { f.OnLifeLoss((int)this.power); } Vanish(); } }
void Start() { this.animatorBehaviour = GetComponent<AnimatorBehaviour>(); this.lifeBehaviour = GetComponent<LifeBehaviour>(); //add content this.lifeBehaviour.life = life; this.lifeBehaviour.currentLife = this.lifeBehaviour.life; this.velocity = Random.Range(1.8f, 2.2f); }