public InputHandler(Game g, LazyGameObject <Player> p, InputBridge br) { MyGame = g; AssociatedPlayer = p; Bridge = br; bottomState.MyGame = MyGame; bottomState.MyBridge = Bridge; bottomState.MyPlayer = AssociatedPlayer; }
public MainTick() { goManager = new Core.GameObjectManager(); renderManager = new Render.RenderManager(goManager); inputBridge = new Input.InputBridge(renderManager); gameManager = new Game.GameManager(); uiManager = new GUI.UIManager(); renderManager.SetUIManager(uiManager); Update(); }
public void AssociateInputBridge(InputBridge ib, Int32 PlayerID) { if (InputHandlers.ContainsKey(PlayerID)) { InputHandlers[PlayerID].Bridge = ib; } else { InputHandlers.Add(PlayerID, new InputHandler(this, new LazyGameObject <Player>(PlayerID), ib)); } }
public static bool IsKeyPressed(string key) { try { return(InputBridge.IsKeyPressed(key)); } catch { return(false); } }
public static PointF DragMouseHere(this PointF p, int offsetX = 0, int offsetY = 0) { if (offsetX == 0 && offsetY == 0) { return(SetMouseHere(p)); } InputBridge.SendMouse(Models.MouseEventType.LEFT_DOWN); Thread.Sleep(5); InputBridge.MoveMouse(Models.Point2d.FromPointF(p.Offset(offsetX, offsetY)), true); Thread.Sleep(5); InputBridge.SendMouse(Models.MouseEventType.LEFT_UP); return(p); }
void Start() { ib = Player.GetComponent <InputBridge>(); CraftSpawnP = craft.transform.position; CraftSpawnR = craft.transform.rotation; CubeSpawnR = cube.transform.rotation; //Rotations - default is when controller is facing forward, as per normal holding //w is ?, defaults at 1 //x is //y is ?, default is 0. Move controller left=+. Move controller right = - //z is roll, defaults at 0 }
public static PointF Click(this PointF p, bool rightClick = false) { if (rightClick) { InputBridge.SendMouse(Models.MouseEventType.RIGHT_DOWN); InputBridge.SendMouse(Models.MouseEventType.RIGHT_UP); } else { InputBridge.SendMouse(Models.MouseEventType.LEFT_DOWN); InputBridge.SendMouse(Models.MouseEventType.LEFT_UP); } return(p); }
void Start() { _animator = GetComponent <Animator>(); _input = InputBridge.Instance; _grabbable = GetComponent <Grabbable>(); }
public static PointF SetMouseHere(this PointF p, int offsetX = 0, int offsetY = 0) { InputBridge.SetCursorPosition(Models.Point2d.FromPointF(p.Offset(offsetX, offsetY))); return(new PointF(p.X + offsetX, p.Y + offsetY)); }
void Start() { ib = Player.GetComponent <InputBridge>(); }