using System; using System.Collections.Generic; using cfg; using cfg.LevelCfg; using Framework; using Gameplay; using Gameplay.Level; using PhxhSDK; namespace Gameplay { public class JumpToManager { private static Dictionary _jumpDic = new Dictionary() { [JumpFuncType.Cultivate_Character] = (Action) JumpToCultivateCharacter, }; private static void _DoJumpFunc(JumpFuncType key) { var action = _jumpDic[key]; if (action is Action act) { act(); } } private static void _DoJumpFunc(JumpFuncType key, T param) { var action = _jumpDic[key]; if (action is Action act) { act(param); } } public static void JumpFunc(JumpFuncType key) { _DoJumpFunc(key); } public static void JumpFunc(JumpFuncType key, T param) { _DoJumpFunc(key, param); } public static void JumpToCultivateCharacter(int uid) { } public static async void JumpToLevelDetail(int levelId) { DebugUtil.Log("Jump to : " + levelId); DataLevel data = TableManager.Instance.Tables.Level.Get(levelId); if(data == null) { DebugUtil.Log("Jump to level detail failed, level id not found: " + levelId); return; } //TODO: levelmanager检查关卡合法性与解锁情况 LevelInfo levelInfo = LevelManager.Instance.GetLevelInfoByID(levelId);//new LevelInfo(data); await UI_LevelSelectController.Open(levelInfo); UI_LevelDetailController.Open(levelInfo); //EventManager.Instance.Send(EventManager.EventName.WindowJumpFinished); } } }