public void Switch(LockCheck other) { mySet.ownsLockedObject = false; var tempParent = other.transform.parent; var tempSet = other.mySet; other.transform.parent = transform.parent; other.mySet = mySet; other.mySet.myObjects[sectionId] = other.GetComponent <VisibilityCheck>(); other.mySet.myLockObjects[sectionId] = other; transform.parent = tempParent; mySet = tempSet; mySet.myLockObjects[sectionId] = this; mySet.myObjects[sectionId] = GetComponent <VisibilityCheck>(); }
public void LockObject(int id, LockCheck obj) { if (currentlyLockedObject != null) { currentlyLockedObject.TriggerLock(); } foreach (var s in otherSections) { if (s.currentlyLockedObject != null) { s.currentlyLockedObject.TriggerLock(); } } lockedObject = id; currentlyLockedObject = obj; }
public void SetLockCheckBox(bool state) { LockCheck.Invoke(new SetCheckDelegate(SetCheckHelper), new object[] { LockCheck, state }); }
public void UnlockObject() { lockedObject = -1; currentlyLockedObject.Switch(currentlyActiveSet.myLockObjects.Where(x => x.sectionId == currentlyLockedObject.sectionId).ToArray()[0]); currentlyLockedObject = null; }