public override void update()
 {
     if (_timer.isReady())
     {
         _machine.changeState(AttackStateType.WAIT);
     }
 }
예제 #2
0
    public override void update()
    {
        // Debug.Log("Buff Update");
        if (_timer.isReady())
        {
            this._reciever.GetComponent <ActorBuffMgr>().removeBuff(this);
        }
        Profile profile = _reciever.GetComponent <Profile>();

        profile.position += new Vector2(Random.Range(-0.1f, 0.1f), Random.Range(-0.1f, 0.1f));
    }
예제 #3
0
    public override void update()
    {
        //todo..考虑使用函数式思路,直接按照不同的攻击类型替换update函数内容,不进行if判定
        //此处代码实现singular逻辑(单体攻击)

        /*
         * 1.如果捕获目标丢失,则重置前摇
         * 2.如果捕获目标一直处于攻击范围内,则在前摇完成后进行攻击,并进入后摇
         */

        if (!_machine.profile.nodeCapture.Contains(_singularTarget))          //Logic.1
        {
            _machine.changeState(AttackStateType.PREPARE);
            return;
        }

        if (_timer.isReady())          //Logic.2
        {
            _machine.launchAttack(_singularTarget);
            _machine.changeState(AttackStateType.AFTER);
            return;
        }
    }