Exemplo n.º 1
0
    public void PerformTurn()
    {
        ActionData  nextAction = DetermineActionToPerform();
        List <Unit> targets    = DetermineActionTargets(nextAction);

        nextAction.PerformAction(EnemyBody, targets.ToArray());
    }
Exemplo n.º 2
0
    // Update is called once per frame
    public void ProcessInput()
    {
        if (isMoving)
        {
            return;
        }
        CancelPressed = CancelPressed || Input.GetButtonDown("Cancel");
        if (CancelPressed && !isMoving)
        {
            SelectPressed = CancelPressed = false;
            ParentHolder.CloseMenuAndReOoenCaller();
            return;
        }
        SelectPressed = SelectPressed || Input.GetButtonDown("Submit");
        if (SelectPressed && !isMoving)
        {
            SelectPressed = CancelPressed = false;
            ActionData selectedAction = this.AvailableActions.List[SelectedIndex];
            if (!selectedAction.CanPerformAction(ActingUnit.Value))
            {
                return; // do no perform actions that cannot be done
            }
            if (selectedAction.TargetType != TargetType.Targetless)
            {
                ActivateTargettingSystem();
            }
            else
            {
                selectedAction.PerformAction(ActingUnit.Value, null);
                this.ParentHolder.CloseAllMenus();
            }
            return;
        }

        float verticalAxis = Input.GetAxis("Vertical");

        HandleVerticalInput(verticalAxis);
    }
Exemplo n.º 3
0
 public void ExecuteCurrentlySelectedActions()
 {
     CurrentAction.PerformAction(ActingUnit.Value, GetTargetedUnits());
     this.CloseAllMenus();
 }