internal static void RegisterController(UIController controller) { _controllers.Push(controller); if (controller is UISceneController) { _currentSceneController = (UISceneController)controller; if (SceneLoaded != null) { SceneLoaded(); } } }
public static object[] PollArgs(UIController controller) { if (controller is UISceneController) { _currentSceneController = (UISceneController)controller; } if (_args.Count > 0) { return(_args.Pop()); } return(new object[] {}); }
public static AsyncOperation Load(Type type, object[] args) { if (SceneUnloaded != null) { SceneUnloaded(); } _currentSceneController = null; _controllers.Clear(); List <object> loading_args = new List <object>(args); if (_currentSceneType == LoadingSceneType) { _currentSceneType = type; loading_args.RemoveAt(0); _args.Push(loading_args.ToArray()); } else { _currentSceneType = LoadingSceneType; loading_args.Insert(0, type); _args.Push(loading_args.ToArray()); } UISceneNameAttribute sceneName = GetAttribute <UISceneNameAttribute>(_currentSceneType); if (sceneName == null) { throw new Exception(string.Format("Scene name for type {0} not defined. Use UISceneNameAttribute", _currentSceneType)); } return(SceneManager.LoadSceneAsync(sceneName.Name)); }