public static void UpdateValidators(CriticalSections updateMask, CriticalSections activeMask) { for (int index = UIValidator.Validators.Count - 1; index >= 0; --index) { if ((UIValidator.Validators[index].Mask & updateMask) != (CriticalSections)0) { UIValidator.Validators[index].UpdateInteractable(activeMask); } } }
public static CriticalSections GetActive() { CriticalSections criticalSections = (CriticalSections)0; for (int index = 3; index >= 0; --index) { if (CriticalSection.mCounts[index] > 0) { criticalSections |= (CriticalSections)(1 << index); } } return(criticalSections); }
private void UpdateInteractable(CriticalSections csMask) { bool flag = true; if ((csMask & this.Mask) != (CriticalSections)0) { flag = false; } if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Input, (UnityEngine.Object)null) && string.IsNullOrEmpty(this.Input.get_text())) { flag = false; } if (this.ExtraInput != null) { foreach (InputField inputField in this.ExtraInput) { if (string.IsNullOrEmpty(inputField.get_text())) { flag = false; break; } } } if ((this.ToggleMask & UIValidator.ToggleMasks.Enable) != (UIValidator.ToggleMasks) 0) { Selectable component = (Selectable)((Component)this).GetComponent <Selectable>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { ((Behaviour)component).set_enabled(flag); } } if ((this.ToggleMask & UIValidator.ToggleMasks.Interactable) != (UIValidator.ToggleMasks) 0) { Selectable component = (Selectable)((Component)this).GetComponent <Selectable>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { component.set_interactable(flag); } } if ((this.ToggleMask & UIValidator.ToggleMasks.BlockRaycast) == (UIValidator.ToggleMasks) 0) { return; } CanvasGroup component1 = (CanvasGroup)((Component)this).GetComponent <CanvasGroup>(); if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null)) { return; } component1.set_blocksRaycasts(flag); }
public static void Leave(CriticalSections mask = CriticalSections.Default) { CriticalSections updateMask = (CriticalSections)0; for (int index = 3; index >= 0; --index) { if ((mask & (CriticalSections)(1 << index)) != (CriticalSections)0) { --CriticalSection.mCounts[index]; if (CriticalSection.mCounts[index] == 0) { updateMask |= (CriticalSections)(1 << index); } } } if (updateMask == (CriticalSections)0) { return; } UIValidator.UpdateValidators(updateMask, CriticalSection.GetActive()); }