Example #1
0
        protected virtual void Awake()
        {
            SetActive(startEnabled);

            Register();

            canvasGroup = GetComponent <CanvasGroup>();
            if (!canvasGroup)
            {
                canvasGroup = gameObject.AddComponent <CanvasGroup>();
            }

            // UI blocker
            blocker = GetComponent <UIBlocker>();
            if (!blocker)
            {
                blocker = gameObject.AddComponent <UIBlocker>();
                UISettings.UIPageData data = UISettings.GetPageData(name);
                if (data != null)
                {
                    blocker.Setup(name, data.blockUI);
                }
            }
            if (blocker)
            {
                blocker.ForceStart();
            }
        }
Example #2
0
        public static void Unblock(UIBlocker block)
        {
            if (block == null || block.UIID == null || block.blockUIs == null)
            {
                return;
            }

            // Unblock each UI in the list
            foreach (string target in block.blockUIs)
            {
                Unblock(target, block);
            }
        }
Example #3
0
        public static void Unblock(string blockTo, UIBlocker blockFrom)
        {
            UIBlockInfo bInfo = GetBlockInfo(blockTo);

            if (bInfo != null)
            {
                bInfo.blockFrom.Remove(blockFrom);
                CleanBlocker();

                if (!IsBlock(blockTo))
                {
                    UIBlockSystemLock(GetObjects(blockTo), false);
                }
            }
        }
Example #4
0
        public static void Block(string blockTo, UIBlocker blockFrom)
        {
            if (blockTo == null)
            {
                return;
            }

            bool isBlocked = IsBlock(blockTo);

            UIBlockInfo bInfo = GetOrAddBlockInfo(blockTo);

            if (bInfo != null)
            {
                bInfo.Block(blockFrom);
                if (!isBlocked)
                {
                    UIBlockSystemLock(GetObjects(blockTo));
                }
            }
        }
Example #5
0
 public void Block(UIBlocker bFrom)
 {
     Clean();
     blockFrom.Add(bFrom);
 }