Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (battleOrder == null)
        {
            return;
        }
        switch (state)
        {
        case State.ATTACKING:
            timer += Time.deltaTime;
            if (!battleOrder.SourceCombatant.animating && timer > maxTimer)
            {
                state = State.FINISHED;
                Combatant targetCombatant = battleOrder.TargetTile.GetOccupant();
                if (targetCombatant != null)
                {
                    targetCombatant.DoneAnimating();
                    targetCombatant.CheckStatus();
                }
            }
            break;

        case State.MOVING:
            WalkToDestination();
            break;

        case State.FINISHED:
            battleStateTracker.ResetChain();
            break;
        }
    }