コード例 #1
0
ファイル: Hitbox.cs プロジェクト: Kryxzael/RoomShuffle
    /// <summary>
    /// Lets the provided hurtbox damage the hitbox
    /// </summary>
    /// <param name="hurtbox"></param>
    public void TryDealDamageBy(Hurtbox hurtbox)
    {
        //The hurtbox cannot deal damage to this hitbox
        if ((HasInvincibilityFrames && !hurtbox.IgnoresInvincibilityFrames) || !hurtbox.GetTargets().HasFlag(SusceptibleTo))
        {
            return;
        }

        hurtbox.OnDealDamage(this);
        OnReceiveDamage(hurtbox);
    }