Esempio n. 1
0
        protected override void OnTriggerEnter(Collider other)
        {
            base.OnTriggerEnter(other);

            if (other.gameObject.layer == TankEternalGameSettings.EnemyLayerId)
            {
                var vitality = other.GetComponent <TankEternalEnemyPawn>().Vitality;
                vitality.AddHealth(-TankEternalGameSettings.CalculateRealDamage(Damage, vitality));
            }
        }
Esempio n. 2
0
        private void OnCollisionEnter(Collision other)
        {
            if (other.gameObject.layer == TankEternalGameSettings.PlayerLayerId)
            {
                gameObject.SetActive(false);

                var vitality = PlayerPawn.Vitality;
                vitality.AddHealth(-TankEternalGameSettings.CalculateRealDamage(Damage, vitality));
            }
        }