private string GetCategorySceneName(GameLevelCategory category) { if (!FortScene.IsNullOrEmpty(category.DefaultScene)) { return(category.DefaultScene.Value.SceneName); } if (InfoResolver.Resolve <FortInfo>().GameLevel.LevelCategoriesParentMap.ContainsKey(category.Id)) { return(GetCategorySceneName(InfoResolver.Resolve <FortInfo>().GameLevel.LevelCategoriesParentMap[category.Id])); } return(string.Empty); }
private string ResolveGameLevelSceneName(GameLevelInfo level) { if (!FortScene.IsNullOrEmpty(level.Scene)) { return(level.Scene.Value.SceneName); } string categorySceneName = GetCategorySceneName(InfoResolver.Resolve <FortInfo>().GameLevel.LevelCategoriesParentMap[level.Id]); if (!string.IsNullOrEmpty(categorySceneName)) { return(categorySceneName); } return(FortScene.IsNullOrEmpty(InfoResolver.Resolve <FortInfo>().GameLevel.DefaultScene)?null: InfoResolver.Resolve <FortInfo>().GameLevel.DefaultScene.Value.SceneName); }
public void LoadGameLevelAsync(GameLevelInfo level) { if (FortScene.IsNullOrEmpty(InfoResolver.Resolve <FortInfo>().GameLevel.LoaderScene.Value)) { throw new Exception("No Loader Scene is defined in Game Level config"); } _lastLoadGameAsync = level; ServiceLocator.Resolve <ISceneLoaderService>().Load(new SceneLoadParameters(InfoResolver.Resolve <FortInfo>().GameLevel.LoaderScene.Value.SceneName) { AddToSceneStack = false, CaptureReturnKey = false, Context = level, FlushSceneStack = true }); }