/// <summary> /// Raises <see cref="ICommand.CanExecuteChanged" /> on the UI thread so every /// command invoker can require <see cref="ICommand.CanExecute" /> to check if the /// CompositeCommand can execute. /// </summary> protected virtual void OnCanExecuteChanged() { #if UNITY3D if (_executeMethod != null && _executeMethod.IsAlive && _executeMethod.Target != null) { // gameObject.collider.enabled = IsEnabled; } #endif if (_canExecuteChangedHandlers == null) { return; } _canExecuteChangedHandlers.Raise(false, this, EventArgs.Empty); }
/// <summary> /// This raises the DelegateCommand.IsActiveChanged event. /// </summary> protected virtual void OnIsActiveChanged() { #if UNITY3D //Debug.Log("OnIsActiveChanged"); if (_executeMethod != null && _executeMethod.IsAlive && _executeMethod.Target != null) { if (gameObject != null) { gameObject.SetActive(IsActive); //Debug.Log(string.Format("OnIsActiveChanged, IsActive = {0}", IsActive)); } } #endif if (_isActiveChangedHandlers == null) { return; } _isActiveChangedHandlers.Raise(false, this, EventArgs.Empty); }