コード例 #1
0
ファイル: PlayerBullet.cs プロジェクト: osmet/BNZTest
        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));
            }
        }
コード例 #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));
            }
        }