示例#1
0
 private void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(State))
     {
         SwitchStateChanged?.Invoke(this, new SwitchStateChangedEventArgs(Position, State));
     }
 }
示例#2
0
        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;
            }
        }
示例#3
0
 /// <summary>
 /// Diese Methode informiert alle registrierten Eventhandler über den Zustandswechsel
 /// (ein-/ausgeschaltet) des Schalters.
 /// </summary>
 public void OnSwitchStateChanged(SwitchEventArgs e) => SwitchStateChanged?.Invoke(this, e);