Exemplo n.º 1
0
        protected override void Awake()
        {
            base.Awake();

            instantiatorDic = new Dictionary <System.Type, GameObject>();

            foreach (var p in _prefabs)
            {
                foreach (var i in ClassManager.GetTypesDefinedWith <GM_AttributeInstantiator>())
                {
                    if (instantiatorDic.ContainsKey(i.Value) == true)
                    {
                        continue;
                    }

                    if (p.GetComponent(i.Value) != null)
                    {
                        instantiatorDic.Add(i.Value, p);
                        continue;
                    }

                    if (p.GetComponentInChildren(i.Value) != null)
                    {
                        instantiatorDic.Add(i.Value, p);
                        continue;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void RegisterWindow(UI_WindowBase window)
        {
            if (IsWindowRunning(window) == true)
            {
                return;
            }

            var blockUIDic = ClassManager.GetTypesDefinedWith <GM_AttributeBlockController>();
            var windowName = window.GetType().Name;

            if (blockUIDic.ContainsKey(windowName) == true)
            {
                IsUIBlockingController = true;
            }

            runningWindow.Add(window.GetType().Name, window);
        }
Exemplo n.º 3
0
        public void UnregisterWindow(UI_WindowBase window)
        {
            if (IsWindowRunning(window) == false)
            {
                return;
            }

            runningWindow.Remove(window.GetType().Name);

            var blockUIDic       = ClassManager.GetTypesDefinedWith <GM_AttributeBlockController>();
            var turnOffUIBlocker = true;

            foreach (var w in runningWindow)
            {
                if (blockUIDic.ContainsKey(w.Key) == true)
                {
                    turnOffUIBlocker = false;
                    break;
                }
            }

            IsUIBlockingController = !turnOffUIBlocker;
        }