// Update is called once per frame void Update() { if (Input.GetKeyDown(increaseKey)) { counterController.SetValue(counterController.destinationValue + step); } if (Input.GetKeyDown(decreaseKey)) { counterController.SetValue(counterController.destinationValue - step); } }
void Start() { var sub1 = container.content.ObserveCountChanged(true) .Delay(TimeSpan.FromSeconds(delay)) .Select(c => Countdown ? RequiredCount - c : c) .Subscribe(c => { counter.SetValue(c); }); AddSubscriptions(sub1); }