private void Awake()
        {
            if (instance == null)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
            }

            if (_screenContent == null)
            {
                _screenContent = transform;
            }
        }
Ejemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            EditorGUILayout.BeginVertical(GUI.skin.box);

            EditorGUILayout.LabelField("Live Screens");

            ScreenDirector realTarget      = (ScreenDirector)target;
            var            liveScreenNames = realTarget.LiveScreenNames;

            for (int i = 0; i < liveScreenNames.Count; i++)
            {
                EditorGUILayout.BeginHorizontal(GUI.skin.button);
                EditorGUILayout.LabelField(liveScreenNames[i]);
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.EndVertical();
        }
        private IEnumerator Coro_ExecuteLoading(LoadingData load)
        {
            yield return(Coro_Progress(load));

            if (string.IsNullOrEmpty(load.nextScreen))
            {
                ScreenDirector.CloseScreen(this, false);
            }
            else
            {
                if (load.forceClose)
                {
                    ScreenDirector.CloseScreen(this, false);
                }
                else
                {
                    ScreenDirector.LoadScreen(load.nextScreen, load, load.isNextScreenCached);
                }
            }

            coroutine = null;
        }
 public LoadJob(ScreenDirector screenDirector, LoadJobInfo jobData)
 {
     _screenDirector = screenDirector;
     _jobData        = jobData;
     _state          = State.Load;
 }
 static public void Open(LoadingData loadingData)
 {
     ScreenDirector.LoadScreen("ScreenLoading", loadingData, loadingData.isLoadingScreenCached);
 }