コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 public override void Excecute()
 {
     rtsum.EndUnitSelectionAt(ClickPositionManager.PlanePosMouse());
     ui.TurnOffCurentMenus();
 }
コード例 #3
0
 // Update is called once per frame
 void Start()
 {
     instance = this;
 }
コード例 #4
0
 public override void Excecute()
 {
     structure.SetSpawnPosTo(ClickPositionManager.TileClicked(), ClickPositionManager.PlanePosMouse());
 }
コード例 #5
0
 public override void Excecute()
 {
     rtsum.StartUnitSelectionAt(ClickPositionManager.PlanePosMouse());
 }
コード例 #6
0
 public override void Excecute()
 {
     rtsum.Build(ClickPositionManager.TileClicked(), ClickPositionManager.PlanePosMouse(), "Factory", 400);
     GetComponent <CancelBuildingComand>().Excecute();
 }
コード例 #7
0
 public override void Excecute()
 {
     rtsum.MoveUnitsTo(ClickPositionManager.TileClicked(), ClickPositionManager.PlanePosMouse());
 }