public static void SetAllButtonLock(this PlatController ctrl, bool value) { foreach (var btn in ctrl.GetAllButton()) { (btn as IButtonController).SetLock(value); } }
private void DrawButtonList() { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Lock All")) { controller.SetAllButtonLock(true); } if (GUILayout.Button("Unlock All")) { controller.SetAllButtonLock(false); } EditorGUILayout.EndHorizontal(); foreach (var btn in controller.GetAllButton()) { DrawButtonItem(btn); } }