Example #1
0
        public void UpdatePanelOnMouse()
        {
            Vector2 p   = Camera.main.ScreenToWorldPoint(new Vector2(Input.mousePosition.x, Input.mousePosition.y));
            NVector pos = new NVector((int)p.x, (int)p.y, GameMgmt.Get().newMap.view.ActiveLevel);

            Debug.Log($"Click on {pos}");

            if (!pos.Valid())
            {
                NAudio.PlayBuzzer();
                return;
            }

            //active action?
            if (_action != null)
            {
                _action.Click(pos);
            }
            else
            {
                UpdatePanel(pos);
            }

            //center mouse?
            if (LSys.tem.options["centermouse"].Bool())
            {
                S.CameraMove().MoveTo(pos);
            }
        }
Example #2
0
 private void ConnectGameObjs()
 {
     gameRound = ScriptableObject.CreateInstance <GameRoundMgmt>();
     //unit = GameObject.Find("UnitMgmt").GetComponent<UnitMgmt>();
     //building = GameObject.Find("BuildingMgmt").GetComponent<BuildingMgmt>();
     //newMap = FindObjectOfType<GameMap>();
     //cameraMove = FindObjectOfType<CameraMove>();
     self = this;
 }
Example #3
0
File: S.cs Project: TrutzX/9Nations
 public static MapElementInfo MapElement(NVector pos)
 {
     if (GameMgmt.Get().unit.Free(pos))
     {
         return(Building(pos));
     }
     else
     {
         return(Unit(pos));
     }
 }
Example #4
0
File: S.cs Project: TrutzX/9Nations
 public static InputAction InputAction()
 {
     return(GameMgmt.Get().inputAction);
 }
Example #5
0
File: S.cs Project: TrutzX/9Nations
 public static GameMap Map()
 {
     return(GameMgmt.Get().newMap);
 }
Example #6
0
File: S.cs Project: TrutzX/9Nations
 public static GameMgmt Game()
 {
     return(GameMgmt.Get());
 }
Example #7
0
File: S.cs Project: TrutzX/9Nations
 public static UnitInfo Unit(NVector pos)
 {
     return(GameMgmt.Get().unit.At(pos));
 }
Example #8
0
File: S.cs Project: TrutzX/9Nations
 public static UnitMgmt Unit()
 {
     return(GameMgmt.Get().unit);
 }
Example #9
0
File: S.cs Project: TrutzX/9Nations
 public static BuildingInfo Building(NVector pos)
 {
     return(GameMgmt.Get().building.At(pos));
 }
Example #10
0
File: S.cs Project: TrutzX/9Nations
 public static BuildingMgmt Building()
 {
     return(GameMgmt.Get().building);
 }
Example #11
0
File: S.cs Project: TrutzX/9Nations
 public static GameRoundMgmt Round()
 {
     return(GameMgmt.Get().gameRound);
 }
Example #12
0
File: S.cs Project: TrutzX/9Nations
 public static Town Town(int tid)
 {
     return(GameMgmt.Get().data.towns.Get(tid));
 }
Example #13
0
File: S.cs Project: TrutzX/9Nations
 public static TownMgmt Towns()
 {
     return(GameMgmt.Get().data.towns);
 }
Example #14
0
File: S.cs Project: TrutzX/9Nations
 public static PlayerMgmt Players()
 {
     return(GameMgmt.Get().data.players);
 }
Example #15
0
File: S.cs Project: TrutzX/9Nations
 public static bool Valid(int x, int y)
 {
     return(!(y < 0 || x < 0 || y >= GameMgmt.Get().data.map.height || x >= GameMgmt.Get().data.map.width));
 }
Example #16
0
File: S.cs Project: TrutzX/9Nations
 public static CameraMove CameraMove()
 {
     return(GameMgmt.Get().cameraMove);
 }