Exemple #1
0
 // Use this for initialization
 void Awake()
 {
     ui  = FindObjectOfType <FlyUI>();
     giv = FindObjectOfType <GiveEnemy>();
     gt  = FindObjectOfType <GetThing>();
     au  = FindObjectOfType <MusicAll>();
 }
Exemple #2
0
 void BossDie()
 {
     GetComponent <Collider2D>().enabled = false;
     if (FlyUI.scoreAdd != null)
     {
         FlyUI.scoreAdd(lastScore);
     }
     gt.GetThings(transform.position, Random.Range(0, 10));
     Destroy(this.gameObject);
 }
Exemple #3
0
 public void Die()
 {
     GetComponent <Collider2D>().enabled = false;
     if (FlyUI.scoreAdd != null)
     {
         FlyUI.scoreAdd(enemyScore);
     }
     GetEnemy.Instance.enemys.Remove(this);
     gt.GetThings(transform.position, Random.Range(0, 10));
     Destroy(this.gameObject);
 }
Exemple #4
0
    void Start()
    {
        ui              = FindObjectOfType <FlyUI>();
        FlyUI.scoreAdd += this.AddScore;
        FlyUI.dieAdd   += this.AddDie;
        Vector3 rect = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, Screen.height));

        halfBoardX = this.GetComponent <Renderer>().bounds.size.x / 4;
        halfBoardY = this.GetComponent <Renderer>().bounds.size.y / 4;
        maxX       = rect.x - halfBoardX;
        maxY       = rect.y - halfBoardY;
    }
Exemple #5
0
 public void Hurt(int damage)
 {
     if (hp > 0)
     {
         hp -= damage;
         if (FlyUI.scoreAdd != null)
         {
             FlyUI.scoreAdd(damage * 4);
         }
         if (hp <= 0)
         {
             PlayEffect();
             BossDie();
             giv.isNull = true;
             au.Bgm(3);
             ui.winOrNext();
         }
     }
 }
Exemple #6
0
 public void Hurt(int damage)
 {
     if (hp > 0)
     {
         hp -= damage;
         GetHelp();
         if (FlyUI.scoreAdd != null)
         {
             FlyUI.scoreAdd(damage * 2);
         }
         if (hp <= 0)
         {
             PlayEffect();
             BossDie();
             giv.isNull = true;
             au.Bgm(0);
         }
     }
 }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     ui = FindObjectOfType <FlyUI>();
     ui.BigBoomNum(num);
 }