private void Start()
    {
        this.FixedUpdateAsObservable()
        .Select(_ => playerInput.hasAttacked)
        .Where(hasPressedKey => (hasPressedKey) && !CheckNoSkillsInEffect())
        .Timestamp()
        .Where(x => x.Timestamp > _lastBasicAttack.AddSeconds(basicAttack_Interval))
        .Subscribe(x => {
            if (playerShots.TakeShots(basicAttack_Cost))
            {
                _lastBasicAttack = x.Timestamp;
                skillBasicAttack.UseSkill(false);
            }
        })
        .AddTo(this);

        this.FixedUpdateAsObservable()
        .Select(_ => playerInput.hasActivated_Skill1)
        .Where(hasPressedKey => (hasPressedKey))
        .Timestamp()
        .Where(x => x.Timestamp > _lastSpecial1.AddSeconds(special_1_Interval))
        .Subscribe(x => {
            if (playerShots.TakeShots(special_1_Cost))
            {
                _lastSpecial1 = x.Timestamp;
                skillSpecial_1.UseSkill(false);
            }
        })
        .AddTo(this);

        this.FixedUpdateAsObservable()
        .Select(_ => playerInput.hasActivated_Skill2)
        .Where(hasPressedKey => (hasPressedKey))
        .Timestamp()
        .Where(x => x.Timestamp > _lastSpecial2.AddSeconds(special_2_Interval))
        .Subscribe(x => {
            if (playerShots.TakeShots(special_2_Cost))
            {
                _lastSpecial2 = x.Timestamp;
                skillSpecial_2.UseSkill(false);
            }
        })
        .AddTo(this);
    }
        public void FsUnixTime_Move_One_Hour_ahead()
        {
            var d0 = new System.DateTimeOffset(2016, 3, 31, 1, 2, 3, TimeSpan.Zero);
            var d1 = d0.AddSeconds(60 * 60);

            var ut0 = new FsUnixTime(d0);
            var ut1 = new FsUnixTime(d1);

            Assert.AreEqual((60 * 60 * 1000), ut1.MillisecondsSinceEpoch - ut0.MillisecondsSinceEpoch);

            var d2 = ut1.ToToDateTimeOffset();

            Assert.AreEqual(2016, d2.Year);
            Assert.AreEqual(3, d2.Month);
            Assert.AreEqual(31, d2.Day);
            Assert.AreEqual(2, d2.Hour);
            Assert.AreEqual(2, d2.Minute);
            Assert.AreEqual(3, d2.Second);
        }
示例#3
0
 private void Start()
 {
     if (skillBasicAttack != null)
     {
         this.FixedUpdateAsObservable()
         .Select(_ => playerInput.hasAttacked)
         .Where(hasPressedKey => (hasPressedKey))
         .Timestamp()
         .Where(x => x.Timestamp > _lastBasicAttack.AddSeconds(basicAttack_Interval))
         .Subscribe(x => {
             if (playerStatsSetter.DeductMindLight())
             {
                 _lastBasicAttack = x.Timestamp;
                 skillBasicAttack.UseSkill(false);
             }
         })
         .AddTo(this);
     }
 }