Esempio n. 1
0
    void SetTarget()
    {
        GameObject newTarget = null;

        //Have to reset commandManager's current target to null so right clicks disengage by default
        commandManager.target = null;

        //get click point will set newTarget to whatever the player clicked on
        commandManager.pointSelected = ProgUtils.GetClickPoint(cam, out newTarget);


        if (newTarget != null && newTarget.tag == commandManager.GetEnemySide())
        {
            //the Combat class handles movement towards enemies so it isn't done here
            commandManager.SetManagerTarget(newTarget);
            commandManager.SetAttackTargets();
        }
        else
        {
            //There was no enemy so just move to the pointSelected as usual
            commandManager.MoveTroops();
        }
    }