Beispiel #1
0
    public void ControlSoldier()
    {
        if (Input.GetMouseButton(1))
        {
            moveLimiter.active = true;
        }
        else
        {
            moveLimiter.active = false;
        }
        activeMarker.transform.position = currentSoldier.transform.position;
        // activeMarker.transform.eulerAngles = new Vector3(0,currentSoldier.transform.eulerAngles.y,0);
        gun.transform.LookAt(cam.transform.GetChild(0));
        activeMarker.transform.LookAt(lookTarget.transform);
        moveLimiter.transform.position = posmark;
        if (Vector3.Distance(posmark, currentSoldier.transform.position) > 1)
        {
            EndUseAbility(2);
            if (actionManager.CheckActionPoints(2, moveRemaining, currentSoldier, currentSoldier, GetComponent <TurnManager>()) == true)
            {
            }

            //  IncrementMove(1);
        }

        if (Input.GetKeyUp(KeyCode.Alpha1))
        {
            AbilityButtonPress(0);
        }
        if (Input.GetKeyUp(KeyCode.Alpha2))
        {
            AbilityButtonPress(1);
        }
        if (Input.GetKeyUp(KeyCode.Alpha3))
        {
            AbilityButtonPress(3);
        }


        if (Input.GetKeyUp(KeyCode.T))
        {
            // Debug.Log("who is this:  " + transform.name);
            EndTurn();
        }
        if (Input.GetKeyUp(KeyCode.R) && lastActionPress != -1)
        {
            // CheckRange(currentSoldier.loadout.range);
            TabTarget(0, currentSoldier.team);
        }
        if (Input.GetKeyUp(KeyCode.F) && lastActionPress != -1)
        {
            //CheckRange(currentSoldier.loadout.range);
            TabTarget(1, currentSoldier.team);
        }
        if (Input.GetKeyUp(KeyCode.V) && lastActionPress != -1)
        {
            //CheckRange(currentSoldier.loadout.range);
            TabTarget(2, currentSoldier.team);
        }
    }