projectEli/Assets/NeoFPS/Core/Damage/IShieldManager.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
using UnityEngine;
namespace NeoFPS
{
public interface IShieldManager
{
float shield { get; set; }
float shieldChargeRate { get; set; }
float shieldStepCapacity { get; set; }
int shieldStepCount { get; set; }
ShieldState shieldState { get; }
event ShieldDelegates.OnShieldValueChanged onShieldValueChanged;
event ShieldDelegates.OnShieldStateChanged onShieldStateChanged;
event ShieldDelegates.OnShieldConfigChanged onShieldConfigChanged;
float GetShieldedDamage(float damage, DamageType t);
int FillShieldSteps(int count = 1);
int EmptyShieldSteps(int count = 1);
}
public enum ShieldState
{
Stable,
Empty,
Recharging,
Interrupted
}
public static class ShieldDelegates
{
public delegate void OnShieldStateChanged(IShieldManager shield, ShieldState state);
public delegate void OnShieldValueChanged(IShieldManager shield, float from, float to);
public delegate void OnShieldConfigChanged(IShieldManager shield);
}
}