public static void Show(int sec, string title, GetTimerNoteDelegate notecall) { TipAutoClose tipDialog = MainPanelMgr.Instance.ShowDialog("TipAutoClose") as TipAutoClose; if (null == tipDialog) { return; } tipDialog.Init(sec, title, notecall); }
private void OnPlayerDeath(GameEvent ge, EventParameter parameter) { if (ArenaMgr.Instance.IsArenaFight) { return; } ActorObj actor = parameter.goParameter.GetComponent<ActorObj>(); if (MainRole.Instance.serverID == actor.ServerID) { LuaTable mapCfg = ConfigManager.Instance.Map.GetMapConfig(MapMgr.Instance.EnterMapId); int maptype = mapCfg != null ? mapCfg.Get<int>("type") : 0; #if false if (maptype == (int)ESceneType.SCENE_TYPE_SECERETFB) { int rtime = ConfigManager.Instance.Consts.GetValue<int>("secretAreaTeamRelivetime", "val1"); TipAutoClose.Show(rtime, "你已死亡!", (int sec) => { if (sec == 0) { NetLogicGame.Instance.SendReqRevive(1, 1); } return string.Format("{0}秒后自动复活......", sec); }); return; } else #endif if (maptype == (int)ESceneType.SCENE_TYPE_PERSONBOSS) { MsgData_sPersonalBossResult pBossRes = new MsgData_sPersonalBossResult(); pBossRes.result = 1;//fail CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_PersonalBossResult, EventParameter.Get(pBossRes)); return; } else if (maptype == (int)ESceneType.SCENE_TYPE_PERSONVIP_BOSS) { int relivetime = ConfigManager.Instance.Consts.GetValue<int>("zhiyuanfb", "val1"); TipAutoClose.Show(relivetime, "你已死亡!", (int sec) => { return string.Format("{0}秒后自动复活......", sec); }); } else if (maptype == (int)ESceneType.SCENE_TYPE_ZHIYUANFB ) { int relivetime = ConfigManager.Instance.Consts.GetValue<int>("zhiyuanfb", "val1"); TipAutoClose.Show(relivetime, "你已死亡!", (int sec) => { return string.Format("{0}秒后自动复活......", sec); }); } else if (maptype == (int)ESceneType.SCENE_TYPE_WATER_DUNGEON || maptype == (int)ESceneType.SCENE_TYPE_ZHUZAIROAD) { int relivetime = ConfigManager.Instance.Consts.GetValue<int>("zhiyuanfb", "val1"); TipAutoClose.Show(relivetime, "你已死亡!", (int sec) => { if (sec == 0) { NetLogicGame.Instance.SendReqRevive(1, 1); } return string.Format("{0}秒后自动复活......", sec); }); } else if (maptype == (int)ESceneType.SCENE_TYPE_GUILD_HELL) { } else if (maptype == (int)ESceneType.SCENE_TYPE_ARENA) { } else if (maptype == (int)ESceneType.SCENE_TYPE_CRWON) { } else if (maptype == (int)ESceneType.SCENE_TYPE_YUANZHENG) { } else if(maptype == (int)ESceneType.SCENE_TYPE_GUILD_WAR_ACTIVITY) { int relivetime = ConfigManager.Instance.Consts.GetValue<int>("factfightpowerInfo", "fval"); TipAutoClose.Show(relivetime-1, "你已死亡!", (int sec) => { return string.Format("{0}秒后自动复活......", sec); }); } else { if (CoreEntry.gAutoAIMgr.AutoFight && CoreEntry.gAutoAIMgr.Config.Relive) { //自动复活 System.Action fun = LuaMgr.Instance.GetLuaEnv().Global.Get<System.Action>("CommonRevive"); if (fun != null) { fun(); } } else { OtherPlayer oo = actor.hitActorObject as OtherPlayer; if(oo != null) { UnityEngine.Events.UnityAction<string> fun = LuaMgr.Instance.GetLuaEnv().Global.Get<UnityEngine.Events.UnityAction<string>>("CommonPKReviveSimple"); if (fun != null) { fun(oo.mBaseAttr.Name); } } else { System.Action fun = LuaMgr.Instance.GetLuaEnv().Global.Get<System.Action>("CommonReviveSimple"); if (fun != null) { fun(); } } } } } }