예제 #1
0
    // Player生命回复
    protected static void PlayerHealthRestoreDeal(Transform attacker, float damage)
    {
        Transform player = GetPlayer();

        if (attacker != player)
        {
            return;
        }
        BaseData data = Utils.GetBaseData(player);
        float    rate = Utils.GetWeaponStrengthRestoreRate(data.curWeaponName, data.curWeaponLevel);

        if (rate <= 0)
        {
            return;
        }
        data.AddHealth(damage * rate);
        // 下发通知
        if (AddHealthEvent != null)
        {
            AddHealthEvent(player, damage * rate);
        }
    }