public virtual void Load(string battleID = "") { if (IsInBattle) { CLog.Error("正处于SubBattle中"); return; } TDBaseBattleData tempData = TDLuaMgr.Get <TData>(battleID); if (tempData == null) { CLog.Error("没有这个战场:{0}", battleID); return; } SubBattleCoroutine.Kill(); CurData = tempData.Copy <TData>(); if (CurData != null) { BattleID = tempData.TDID; CurData.OnBeAdded(SelfBaseGlobal); BattleCoroutine.Run(_LoadBattle()); } else { CLog.Error("Battle not found !error id=" + battleID); } }
public virtual void UnLoad() { if (!IsInBattle) { CLog.Error("没有加载SubBattle"); return; } SubBattleCoroutine.Kill(); BattleCoroutine.Run(_UnLoadBattle(() => { SceneManager.SetActiveScene(BaseGlobal.BattleMgr.SceneSelf); BattleCoroutine.Run(BackToBattle()); })); }