/// <summary> /// 离开当前场景时,push场景记录 /// </summary> /// <param name="stg"></param> /// <param name="data"></param> public static void LeaveCurrStageOver(AbstractStage stg, StStageData stageData) { if (stg == nowStage) { if (!backFlag) { stageData.stage = nowStage.GetType(); _stageHistory.Push(stageData); //Debug.Log("push :"+stageData.stage.ToString()); } //Log.info("[StageManager] 离开场景:" + stg.getViewName()); nextStage.RecoverStagePart(nowStage); //下个场景进场 nowStage = nextStage; nextStage.Show(); backFlag = false; } }
/// <summary> /// 返回上一个场景 /// </summary> public static void GotoPrvUIStage() { backFlag = true; if (_stageHistory.Count == 0) { if (OnRunToDefaultStageCallBack != null) { OnRunToDefaultStageCallBack(); } } else { StStageData stageData = _stageHistory.Pop(); AbstractStage stg = null; CreateStage(stageData.stage, ref stg); if (stg == null) { return; } ExecToStage(stg, true); } }