示例#1
0
 // 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);
     }
 }
示例#2
0
    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);
    }