void Update() { if (mapControl != null) { mapControl.Update(); _mouseStatus.Update(); if (_mouseStatus.GetMouseJustDown(MouseStatus.KEY.LEFT) && !UICamera.Raycast(Input.mousePosition)) { Vector3 worldPoint; Vector3 mousePosition = _mouseStatus.GetMouseJustDownPos(); bool raycast = _campaignCamera.ProjectScreenPointToPlane(out worldPoint, mousePosition); if (raycast) { int tileIndex = mapControl.DetectTileIndex(worldPoint); if (tileIndex >= 0) { if (_campaignPanel != null) { _campaignPanel.OnSelectMission(tileIndex + 1); } } } } } }
void handleInput(GameTime gameTime) { KeyboardStatus.Update(Keyboard.GetState( )); MouseStatus.Update(Mouse.GetState( ), Camera); handleCameraControls(gameTime); if (_inputActionLookup.ContainsKey(_userActionInEditor)) { _inputActionLookup[_userActionInEditor]( ); } }
// Update is called once per frame void Update() { //ensure game is the first instance in scane, and call this at the begin of update TimeHelper.SynchronizeTimestampScaled(); if (_state == STATE.UI) { TimeHelper.SetTimeScale(1); } else { TimeHelper.SetTimeScale(_battleSpeed); } // if (!_isPause) { _mouseStatus.Update(); switch (state) { case STATE.INIT: UpdateInit(); break; case STATE.ENTERING: UpdateEntering(); break; case STATE.BATTLE: UpdateBattle(); break; case STATE.OVER: UpdateOver(); break; } _mouseContorl.Update(); _mapCamera.Update(); _mapGrid.UpdateShowTile(); _gameSkillControl.Update(); SychronizeBattleProgress(); ++_gameTick; } }
void Update() { _mouseStatus.Update(); switch (_state) { case STATE.IDLE: UpdateIdle(); break; case STATE.HOLDING: UpdateHolding(); break; case STATE.DRAGGING: UpdateDragging(); break; case STATE.EASING: UpdateEasing(); break; } }