public void update()
    {
        while (_timeline.Count > 0 && _timer.getElapsedTime() > _timeline.First.Value.time)          //解析所有已到时的计数器
        {
            TimeCommand command = _timeline.First.Value;
            _timeline.RemoveFirst();
            if (command.type.Equals("Enemy_Out"))
            {
                RhodesGame.Instance.battle.actorMgr.createEnemy(command.resource);
            }
        }

        //todo
        //更新费用
        //更新全局buff
    }
Beispiel #2
0
    void FixedUpdate()
    {
        if (_routeFinished)          //不能继续前进
        {
            _timeFaultChecker.reset();
            return;
        }

        if (!profile.moveAble)          //判断是否能够进行移动
        {
            _timeFaultChecker.reset();
            return;
        }

        Vector2 target;

        try {
            target = _route[_lastApproach + 1];
        } catch (ArgumentOutOfRangeException) {
            return;
        }

        // Debug.Log(_timeFaultChecker);
        float actualSpeed = profile.speed * _timeFaultChecker.getElapsedTime();

        _timeFaultChecker.reset();
        profile.position = Vector2.MoveTowards(profile.position, target, actualSpeed);

        _emitter.pos(profile.position);
        _emitter.emitEvent(actor, ActorType.NONE);

        if (profile.position == target)
        {
            _setApproach();
        }
    }
 public override float getRemainTime()
 {
     return(_timer.getElapsedTime());
 }