Example #1
0
        private IEnumerator <object> WaitForAll_Coroutine()
        {
            TaskCount = CreateInstances.Count;
            foreach (IEnumerator <object> enumerator in CreateInstances)
            {
                ILRuntimeService.StartILCoroutine(enumerator);
            }

            while (TaskCount > 0)
            {
                yield return(null);
            }
            TaskCount = StartInstance.Count;
            foreach (IEnumerator <object> enumerator in StartInstance)
            {
                ILRuntimeService.StartILCoroutine(enumerator);
            }
            while (TaskCount > 0)
            {
                yield return(null);
            }

            TaskCount = Windows.Count;
            foreach (Type window in Windows)
            {
                AssetBundlePool.LoadAsset <GameObject>(
                    "bmpfont_prefab.assetbundle",
                    window.Name,
                    (gameObject) =>
                {
                    GameSystemData.Instance.PrefabCache.Insert(new PrefabAsset(window.Name, gameObject));
                    TaskCount--;
                });
            }
            while (TaskCount > 0)
            {
                yield return(null);
            }

            GameSystemData.Instance.FontSettingWindow = FontSettingWindow.OpenWindow();
            GameSystemData.Instance.MenuWindow        = MenuWindow.OpenWindow();
            GameSystemData.Instance.RendererWindow    = RendererWindow.OpenWindow();
            Debug.Log("return GameStart.WaitForAll_Coroutine.");
        }
Example #2
0
        public T ShowMenu <T>(UIBase context, Vector2 pos, object obj = null) where T : MenuWindow, new()
        {
            if (currentPop != null)
            {
                currentPop.Hide(); currentPop = null;
            }
            for (int i = 0; i < pops.Count; i++)
            {
                if (pops[i] is T)
                {
                    currentPop = pops[i];
                    pops[i].Show(context, pos, obj);
                    return(pops[i] as T);
                }
            }
            var t = new T();

            pops.Add(t);
            currentPop = t;
            t.Initial(Root, context, obj);
            t.Show(context, pos, obj);
            t.ReSize();
            return(t);
        }