コード例 #1
0
 void SetupLevel()
 {
     SolarSystemGenerator.Instance.GenerateLevel();
     GunController.Instance.Setup();
     this.planets = new List <PlanetBehavior>(FindObjectsOfType <PlanetBehavior>());
     this.star    = GameObject.FindGameObjectWithTag("Star").GetComponent <LifeBehaviour>();
 }
コード例 #2
0
    public void suicide()
    {
        livesLeft--;
        LifeBehaviour b = lives [(lives.Count - livesLeft) - 1].GetComponent <LifeBehaviour> ();

        b.death();
    }
コード例 #3
0
ファイル: BulletBehavior.cs プロジェクト: welintonfm/XGGG
 private void OnCollisionEnter2D(Collision2D other)
 {
     if (other.transform != father)
     {
         LifeBehaviour f = other.gameObject.GetComponent <LifeBehaviour>();
         if (f != null)
         {
             f.OnLifeLoss((int)this.power);
         }
         Vanish();
     }
 }
コード例 #4
0
    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);
    }