Exemple #1
0
 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);
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 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
     });
 }