using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class EventManager : Singleton { /// /// 移动输入事件 /// public Action OnMoveInput; /// /// 玩家移动完成事件 /// public Action OnPlayerArrive; /// /// 保存游戏输入事件 /// public Action OnSaveGameInput; /// /// 回到菜单输入事件 /// public Action OnBackHomeInput; /// /// 玩家生命值变动事件 /// public Action OnHealthChanged; /// /// 玩家攻击力变动事件 /// public Action OnAttackChanged; /// /// 玩家防御力变动事件 /// public Action OnDefenceChanged; /// /// 玩家金钱变动事件 /// public Action OnGoldChanged; /// /// 玩家武器变动事件 /// public Action OnWeaponChanged; /// /// 玩家防具变动事件 /// public Action OnArmorChanged; /// /// 笔记本变动事件 /// public Action OnNotepadChanged; /// /// 背包物品变动事件 /// public Action OnItemChanged; /// /// 对战敌人改变事件 用于更新 UI /// public Action OnEnemyCombated; /// /// 关卡改变事件 参数 1 是旧值 参数 2 是新值 /// public Action OnLevelChanged; /// /// 资源加载完成事件 /// public Action OnResourceLoaded; /// /// 打开商店事件 /// public Action OnShopShow; /// /// 法老权杖上楼事件 /// public Action OnArtifactUp; /// /// 法老权杖下楼事件 /// public Action OnArtifactDown; /// /// 吸血鬼出现事件 /// public Action OnVampireShow; public void RemoveAllEvent(Action action) { if (null != action) { Delegate[] ds = action?.GetInvocationList(); for (int i = 0; i < ds.Length; i++) { action -= ds[i] as Action; } } } }