Esempio n. 1
0
        internal static void RegisterController(UIController controller)
        {
            _controllers.Push(controller);

            if (controller is UISceneController)
            {
                _currentSceneController = (UISceneController)controller;

                if (SceneLoaded != null)
                {
                    SceneLoaded();
                }
            }
        }
Esempio n. 2
0
        public static object[] PollArgs(UIController controller)
        {
            if (controller is UISceneController)
            {
                _currentSceneController = (UISceneController)controller;
            }

            if (_args.Count > 0)
            {
                return(_args.Pop());
            }

            return(new object[] {});
        }
Esempio n. 3
0
        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));
        }