示例#1
0
    protected override void HitOpponent(Collider opponent)
    {
        PlayerBaseHealth player = opponent.GetComponent <PlayerBaseHealth>();

        if (player)
        {
            player.GetDamage(Damage);
            Destroy(gameObject);
        }
    }
示例#2
0
    private void OnTriggerEnter(Collider other)
    {
        PlayerBaseHealth playerHealth = other.GetComponent <PlayerBaseHealth>();

        if (playerHealth)
        {
            playerHealth.GetDamage(_collisionDamage);
            _health.DieFromCollision();
        }
    }