/// <summary>破棄</summary> private void OnDestroy() { if (onChangeMode != null) { onChangeMode.RemoveAllListeners(); onChangeMode = null; } if (onSelect != null) { onSelect.RemoveAllListeners(); onSelect = null; } if (onBeginOrder != null) { onBeginOrder.RemoveAllListeners(); onBeginOrder = null; } if (onUpdateOrder != null) { onUpdateOrder.RemoveAllListeners(); onUpdateOrder = null; } if (onEndOrder != null) { onEndOrder.RemoveAllListeners(); onEndOrder = null; } }
/// <summary>モード切替コールバックの登録</summary> public void AddOnChangeModeListener(UnityAction <bool> onChangeModeAction) { if (onChangeModeAction != null) { if (onChangeMode == null) { onChangeMode = new OnChangeModeCallback(); } onChangeMode.AddListener(onChangeModeAction); } }