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(); } }
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); } }
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); } } }
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)); } } }
public void Block(UIBlocker bFrom) { Clean(); blockFrom.Add(bFrom); }