Exemplo n.º 1
0
 void Awake()
 {
     Instance              = this;
     PlayerControl         = GameObject.Find("GameControl");
     PlayerControlScript   = PlayerControl.GetComponent <SwitchButton> ();
     GameControllerScript  = PlayerControl.GetComponent <GameManager> ();
     CursorSelectionScript = PlayerControl.GetComponent <CursorSelection> ();
     actionOrderHandler    = PlayerControl.GetComponent <TurnActionOrderHandler> ();
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     //gameController = GameObject.Find("GameController").GetComponent<GameController>();
     cursorSelection = GameObject.Find("Cursor").GetComponent<CursorSelection>();
     grid = GameObject.Find("Grid").GetComponent<GridWorld>();
     gameController = GameObject.Find("GameController").GetComponent<GameController>();
     //gridTile = null;
     charStatus = null;
     charMove = null;
     calculateAttackRange = false;
 }
Exemplo n.º 3
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////                 *work on making this only call after move has been resolved*                 /////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //Puts a unit in a place on the grid, selects that place.
    public static void PlaceUnitInGrid(this GridCS GridScript, Unit ThisUnit, Vector2 InitiatorPosition, int InitialLayerNumber, Vector2 TargetPosition, int TargetLayerNumber)
    {
        Tile ThisTile = GetTile(GridScript, InitiatorPosition, InitialLayerNumber);

        ThisTile.prevLoadedUnitScript = ThisUnit;
        ThisTile.LoadedUnitScript     = null;
        ThisTile = GetTile(GridScript, TargetPosition, TargetLayerNumber);
        ThisTile.LoadedUnitScript       = ThisUnit;
        ThisTile.LoadedUnitScript.layer = (int)ThisTile.layerNumber.x;
        ThisUnit.transform.Translate(new Vector3(TargetPosition.x - InitiatorPosition.x, ThisTile.transform.position.y + Tile.UNITLOADDISTANCE - ThisUnit.transform.position.y, TargetPosition.y - InitiatorPosition.y), Space.World);
        GameObject      GameController = GameObject.Find("GameControl");
        CursorSelection Cursor         = GameController.GetComponent <CursorSelection> ();

        Cursor.selectedTile = ThisTile;
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     //gameController = GameObject.Find("GameController").GetComponent<GameController>();
     showMoveConfirmationMenu = false;
     yesChosen = false;
     noChosen = false;
     moveConfirmSelectionIndex = 0;
     afterMoveSelectionIndex = 0;
     showAfterMoveMenu = false;
     //attackChosen = false;
     waitChosen = false;
     cursorSelect = GameObject.Find("Cursor").GetComponent<CursorSelection>();
     gameController = GameObject.Find("GameController").GetComponent<GameController>();
     battle = GameObject.Find("GameController").GetComponent<Battle>();
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     cursorSel = GameObject.Find("Cursor").GetComponent<CursorSelection>();
     cursorMove = GameObject.Find("Cursor").GetComponent<CursorMovement>();
     gridWorld = GameObject.Find("Grid").GetComponent<GridWorld>();
     moveConfirmMenu = GameObject.Find("Main Camera").GetComponent<MoveConfirmMenu>();
     gameController = GameObject.Find("GameController").GetComponent<GameController>();
     battle = GameObject.Find("GameController").GetComponent<Battle>();
     //actionMenuOptionsBool = new bool[actionMenuOptions.Length];
     selectIndex = 0;
     showCharActionMenu = false;
     waitChoosen = false;
     //selectedCharacterName = "";
 }