private void HandlePropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(State)) { SwitchStateChanged?.Invoke(this, new SwitchStateChangedEventArgs(Position, State)); } }
private void InvertState() { State = !State; SwitchStateChanged?.Invoke(); Debug.Log(State); var to = State ? _toRotate : _toRotate * -1; _handle.DORotate(to, .6f); if (State && _wall != null && _wall.isKinematic) { _wall.isKinematic = false; } }
/// <summary> /// Diese Methode informiert alle registrierten Eventhandler über den Zustandswechsel /// (ein-/ausgeschaltet) des Schalters. /// </summary> public void OnSwitchStateChanged(SwitchEventArgs e) => SwitchStateChanged?.Invoke(this, e);