private void InitializeButton(IButtonInstance button) { if (!button.isInitialize) { button.Initialize(this); } }
public void RegistButton(IButtonInstance button) { if (this.ContainsButton(button.ID)) { this.RemoveButton(button.ID); if (isDebug) { Debug.Log(string.Format("{0}將已註冊之按鈕[{1}]覆蓋", debugName, button.ID)); } } this.buttonList.Add(button); button.Initialize(this); if (onButtonChange != null) { onButtonChange(this, new ButtonChangeArgs(button, ButtonChange.REGIST)); } }
private void DrawButtonItem(IButtonInstance btn) { var btnCtrl = btn as IButtonController; EditorGUI.BeginChangeCheck(); GUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); var isLock = GUILayout.Toggle(btnCtrl.isLock, "isLock"); EditorGUILayout.LabelField(string.Format("ID [{0}]", btn.ID)); if (EditorGUI.EndChangeCheck()) { btnCtrl.SetLock(isLock); } GUILayout.EndHorizontal(); if (EditorGUI.EndChangeCheck()) { UnityEditor.EditorGUIUtility.PingObject((btn).gameObject); } }
public ButtonChangeArgs(IButtonInstance button, ButtonChange change) { this.button = button; this.change = change; }