// Add / Remove UILock component public static void Lock(GameObject go, string flag, bool bLock) { if (bLock) { bool bAlreadyLockBy = IsLockBy(go, flag); if (!bAlreadyLockBy) { // Add Component UILocker uilock = go.AddComponent <UILocker>(); uilock.m_flag = flag; } } else { UILocker[] uilocks = go.GetComponents <UILocker>(); foreach (UILocker uilock in uilocks) { if (uilock.m_flag == flag) { // Remove component Destroy(uilock); } } } }
public static void UIBlockSystemLock(GameObject go, bool isLock = true) { if (go != null) { UILocker.LockRecursive(go, "UISystem Block System", isLock); } }
void Unlock() { UILocker.LockRecursive(gameObject, name + ".QucikShelf", false); }
void Lock() { UILocker.LockRecursive(gameObject, name + ".QucikShelf", true); }