public override void Excecute() { GetComponent <DrawSquare>().enabled = false; GameObject taped = ClickPositionManager.ObjectClicked(); Debug.Log("we tapped " + taped); if (taped == null) { return; } if (taped.layer == 9) //unit { if (taped.GetComponent <UnitController>().Owner == gameController.CurrentPlayer) { ui.DisplayBothMenus(taped, "Unit"); } else { ui.DisplayPublicMenu(taped, "Unit"); } rtsum.AddUnitByTap(taped); } if (taped.layer == 8) //hex { rtsum.UnShowSelectedUI(); if (taped.GetComponent <TileController>().Owner == gameController.CurrentPlayer) { ui.DisplayBothMenus(taped, "Tile"); } else { ui.DisplayPublicMenu(taped, "Tile"); } AbstractStructure structure = taped.GetComponent <AbstractStructure>(); if (structure != null) { SetDefaultSpawnPositionCommand spawnPosCommand = GetComponent <SetDefaultSpawnPositionCommand>(); spawnPosCommand.structure = structure; Debug.Log("we have currently entered to the right click set position mode"); GetComponent <PlayerInput>().rightClickInput = spawnPosCommand; } } }
public override void Excecute() { rtsum.EndUnitSelectionAt(ClickPositionManager.PlanePosMouse()); ui.TurnOffCurentMenus(); }
// Update is called once per frame void Start() { instance = this; }
public override void Excecute() { structure.SetSpawnPosTo(ClickPositionManager.TileClicked(), ClickPositionManager.PlanePosMouse()); }
public override void Excecute() { rtsum.StartUnitSelectionAt(ClickPositionManager.PlanePosMouse()); }
public override void Excecute() { rtsum.Build(ClickPositionManager.TileClicked(), ClickPositionManager.PlanePosMouse(), "Factory", 400); GetComponent <CancelBuildingComand>().Excecute(); }
public override void Excecute() { rtsum.MoveUnitsTo(ClickPositionManager.TileClicked(), ClickPositionManager.PlanePosMouse()); }