public virtual void OnNotify(IObservableEvent observableEvent) { if (observableEvent is GunFireEvent ev) { _counterText.text = (_statefullCounter++).ToString(); } }
public void Notify(IObservableEvent @event) { for (int i = 0; i < _observers.Count; i++) { _observers[i].OnNotify(@event); } }
protected override void UnbindProperty() { if (boundProperty != null) { boundProperty.Raised -= OnBoundPropertyRaised; boundProperty = null; } }
public override void OnNotify(IObservableEvent observableEvent) { if (observableEvent is GunShootingStoppedEvent) { _statefullCounter = 0; } base.OnNotify(observableEvent); }
protected override void BindProperty(object property) { boundProperty = property as IObservableEvent; if (boundProperty != null) { boundProperty.Raised += OnBoundPropertyRaised; } else { Debug.LogError($"Property type ({property.GetType()}) different from expected type {typeof(IObservableEvent)}", context); } }
public void OnNotify(IObservableEvent observableEvent) { if (observableEvent is BulletReturnEvent bre) { _slider.value++; } if (observableEvent is GunFireEvent gfe) { _slider.maxValue = gfe.MagazineCapacity; _slider.value = gfe.Free; } }
public EventBoxer(IObservableEvent <TBoxed> boxedEvent) { this.boxedEvent = boxedEvent; boxedEvent.Raised += BoxedEventRaisedHandler; }
public void OnNotify(IObservableEvent observableEvent) { Debug.Log(observableEvent.GetType().Name + ": " + observableEvent.Message); }
public OperatorEventViewModel(IObservableEvent <T> value) { Value = value; }