Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AllMoney != 0)
            {
                hash ^= AllMoney.GetHashCode();
            }
            if (GetMoney != 0)
            {
                hash ^= GetMoney.GetHashCode();
            }
            if (FreeCount != 0)
            {
                hash ^= FreeCount.GetHashCode();
            }
            if (FreeRound != 0)
            {
                hash ^= FreeRound.GetHashCode();
            }
            if (gameResult_ != null)
            {
                hash ^= GameResult.GetHashCode();
            }
            return(hash);
        }
Exemple #2
0
 public void Hurt(float value)
 {
     hp -= value;
     hpUI.SetHpPercent(hp / nowhp);
     hp = hp <= 0 ? 0 : hp;
     if (hp == 0)
     {
         agent.GetComponent <Collider>().enabled = false;
         var go = Instantiate(explodePrefab, transform.position, transform.rotation);
         Destroy(go, 1f);
         GetMoney.moneyAdd(gold);
         level.EnemyDead();
         Destroy(hpUI.gameObject);
         Destroy(this.gameObject);
     }
 }