Esempio n. 1
0
 public virtual void OnNotify(IObservableEvent observableEvent)
 {
     if (observableEvent is GunFireEvent ev)
     {
         _counterText.text = (_statefullCounter++).ToString();
     }
 }
Esempio n. 2
0
 public void Notify(IObservableEvent @event)
 {
     for (int i = 0; i < _observers.Count; i++)
     {
         _observers[i].OnNotify(@event);
     }
 }
Esempio n. 3
0
 protected override void UnbindProperty()
 {
     if (boundProperty != null)
     {
         boundProperty.Raised -= OnBoundPropertyRaised;
         boundProperty         = null;
     }
 }
Esempio n. 4
0
 public override void OnNotify(IObservableEvent observableEvent)
 {
     if (observableEvent is GunShootingStoppedEvent)
     {
         _statefullCounter = 0;
     }
     base.OnNotify(observableEvent);
 }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 6
0
        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;
            }
        }
Esempio n. 7
0
 public EventBoxer(IObservableEvent <TBoxed> boxedEvent)
 {
     this.boxedEvent    = boxedEvent;
     boxedEvent.Raised += BoxedEventRaisedHandler;
 }
Esempio n. 8
0
 public void OnNotify(IObservableEvent observableEvent)
 {
     Debug.Log(observableEvent.GetType().Name + ": " + observableEvent.Message);
 }
Esempio n. 9
0
 public OperatorEventViewModel(IObservableEvent <T> value)
 {
     Value = value;
 }