Пример #1
0
        private void OnLoading(string key, UnityEngine.Object asset, Action <UIActivityIndicator> callback)
        {
            if (!(asset is GameObject prefab))
            {
                Debug.LogError($"Asset of key={key} is not a prefab.");
                return;
            }

            var obj = Instantiate(prefab) as GameObject;

            obj.name       = ACTIVITY_INDICATOR_NAME;
            this.uiLoading = obj.GetComponent <UIActivityIndicator>();
            this.uiLoading.Setup(UIMan.Instance.transform);

            callback?.Invoke(this.uiLoading);
        }
Пример #2
0
        public override void Initialize()
        {
            this.uiLoading = GetComponentInChildren <UIActivityIndicator>();

            this.config      = Resources.Load <UIManConfig>("UIManConfig");
            this.bgRectTrans = this.background.GetComponent <RectTransform>();

            var screens = GetComponentsInChildren <UIManScreen>();

            if (screens.Length > 0)
            {
                for (var i = 0; i < screens.Length; i++)
                {
                    this.screenDict.Add(screens[i].UIType, screens[i]);
                }
                this.CurrentScreen = this.screenDict[screens[screens.Length - 1].UIType];
            }
        }