Ejemplo n.º 1
0
 public void HandleInput()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Place(BoardUtils.ScreenToBoardPosition(Input.mousePosition), GameData.CurrentBattle.CurrentPlayer.AvailableActors[addWarriors_index] as BattleActor);
     }
 }
Ejemplo n.º 2
0
    public void Update()
    {
        InfoText.text = "";

        if (!PerformMenu.Active ||
            !CanvasUtils.ElementContainsScreenPosition(PerformMenu.GetComponent <RectTransform>(), Input.mousePosition))
        {
            if (Input.GetMouseButton(1))
            {
                PerformMenu.Deactivate();

                if (Input.GetMouseButtonDown(1))
                {
                    lastMouseDragPos = Input.mousePosition;
                }
                else
                {
                    Vector3 diff = (lastMouseDragPos - Input.mousePosition) / 50f;
                    Camera.main.transform.position += diff;
                    lastMouseDragPos = Input.mousePosition;
                }
            }

            if (controllers.ContainsKey(CurrentFlow))
            {
                controllers[CurrentFlow].HandleInput();
            }
        }

        Vector2 pos = BoardUtils.ScreenToBoardPosition(Input.mousePosition);

        if (!BoardUtils.IsInsideBoard(pos))
        {
            return;
        }

        BattleObject obj = GameData.CurrentBattle.Board.GetObjectAt(pos);

        if (obj != null)
        {
            InfoText.text = obj.Description;
        }

        if (Input.GetKeyDown(KeyCode.Escape) && PerformMenu.Active)
        {
            PerformMenu.Deactivate();
        }

        if (controllers.ContainsKey(CurrentFlow))
        {
            controllers[CurrentFlow].Update();
        }
    }
Ejemplo n.º 3
0
    public void HandleInput()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Choose(BoardUtils.ScreenToBoardPosition(Input.mousePosition));
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            GameObject.Destroy(currentPattern);
            BattleSceneController.Main.PerformMenu.Deactivate();
            BattleSceneController.Main.SwitchFlow(FlowState.ChooseActorToPerform);
        }
    }
Ejemplo n.º 4
0
    public void HandleInput()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Choose(BoardUtils.ScreenToBoardPosition(Input.mousePosition));
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (BattleSceneController.Main.SelectedActor != null && (BattleSceneController.Main.PerformedAttack || BattleSceneController.Main.PerformedMovement))
            {
                Choose(BattleSceneController.Main.SelectedActor.Position);
            }
        }
    }