示例#1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        IStun stunEnemy = other.gameObject.GetComponent <Enemy>();

        if (stunEnemy != null)
        {
            stunEnemy.StunAttack();
            gameObject.SetActive(false);
        }
    }
示例#2
0
        static HitStruct PowerHit(IDealsDamage Power, IHealth Target)
        {
            HitStruct Hit = Power.GetDamage();

            Target.Health -= Hit.HealthDamage;
            IStun StunTarget = Target as IStun;

            if (StunTarget != null)
            {
                StunTarget.Stun -= Hit.StunDamage;
            }
            return(Hit);
        }