/// <summary> /// tp01_ButtonStateChange - ButtonStateChange event handler /// </summary> /// <param name="device">GenericBase</param> /// <param name="args">ButtonEventArgs</param> void tp01_ButtonStateChange(GenericBase device, ButtonEventArgs args) { try { eButtonName btnName = args.Button.Name; uint btnNum = args.Button.Number; eButtonState btnState = args.Button.State; if (btnState == eButtonState.Pressed) { buttonPanelUtility.ExecuteButtonAction(btnName); if (btnNum > 4) { buttonPanelUtility.SetButtonFb(btnNum, true); } else if (btnNum == 1 || btnNum == 4) { buttonPanelUtility.ToggleFeedback(btnNum); } else if (btnNum == 2) { buttonPanelUtility.DecrementVolumeBar(655); } else if (btnNum == 3) { buttonPanelUtility.IncrementVolumeBar(655); } } } catch (Exception e) { Debug.Log(">>> Error in tp01_ButtonStateChange: " + e.Message, Debug.ErrorLevel.Error, true); } }
public void MoveUp(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { movement.Y = -1.0f; } }
public void GotoNextScene(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { bChange = true; } }
public void MoveDown(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.PRESSED) { movement.Y = 1.0f; } }
public void EnableCameraSpring(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.PRESSED) { cameraSpringEnabled = !cameraSpringEnabled; } }
public void StopGame(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { Exit(); } }
public void Down(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { velocity.Y = amount.X; } }
public void MoveTowardUnoccupiedMapArea(eButtonState buttonState, Vector2 mouseLocation) { if (buttonState == eButtonState.DOWN) { if (gameTime == null) { return; } float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds; if (Utilities.IsVectorInsideWindow(mouseLocation, Resources.GraphicsDevice)) { lastMouseLocation = mouseLocation; //calculate the direction in which to move Vector2 direction = mouseLocation - Position; direction.Normalize(); //float distance = Vector2.Distance(Position, mouseLocation); direction = direction * speed * elapsedTime; Velocity = direction; canAttack = isCloseEnoughToAttack = false; } } }
public void ExitGame(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { this.Exit(); } }
// Use this for initialization protected override void Start() { base.Start(); tiledata = GetComponent <TileData>(); Assert.IsNotNull(tiledata, "A HandButton require a TileData component!"); currentState = (eButtonState)tiledata.Tile.paramContainer.GetIntParam("state"); }
public void fire(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { FireShot(); } }
public void PrevMenuSelect(eButtonState buttonState) { if (buttonState == eButtonState.DOWN && !isTransitioning) { if (prevMenuID != String.Empty && prevMenuID != currentMenuID) { if (clone.Count > 0) { clone.Remove(clone[clone.Count - 1]); } currentMenuID = prevMenuID; menu.ID = currentMenuID; } else if (!prevMenuID.Contains("Gameplay")) { currentMenuID = prevMenuID = "Content/Load/Menu/GameplayMenu.xml"; menu.ID = currentMenuID; menu.Active = true; clone.Clear(); } else if (IsActive) { Activate(buttonState); } } }
public void SelectDown(eButtonState buttonState) { if (buttonState == eButtonState.DOWN) { menu.ItemNumber++; } }
public void SelectUp(eButtonState buttonState) { if (buttonState == eButtonState.DOWN) { menu.ItemNumber--; } }
private void ContinueGame(eButtonState buttonState, Vector2 amount) { // Perform the appropriate action to advance the game and // to get the player back to playing. if (buttonState == eButtonState.DOWN) { if (!level.Player.IsAlive) { level.StartNewLife(); } else if (level.TimeRemaining == TimeSpan.Zero) { if (level.ReachedExit) { levelIndex = level.LevelToLoad; LoadNextLevel(levelIndex); } else { ReloadCurrentLevel(); } } } wasContinuePressed = buttonState == eButtonState.DOWN; }
private void MakePlayerAttack(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { level.PlayerAttack(); } }
private void MovePlayerToRight(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { level.MovePlayerRight(); } }
public void MoveLeft(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.PRESSED) { movement.X = -1.0f; } }
public void TurnRight(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { RotationAmount.X = -1.0f; } }
public void Left(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { velocity.X = -amount.X; } }
private void CastSpell(eButtonState buttonState, Vector2 amount) { // Cast a spell if the player is alive if (buttonState == eButtonState.PRESSED && player.Health > 0) { // Loop through the active spell for (int i = 0; i < currentSpell.Count; i++) { // If it's not casted, then choose this one if (currentSpell[i].SpellCasted == false) { // If player has any magic points left if (player.Magic >= currentSpell[i].MPCost) { currentSpell[i].SpellCasted = true; // Decrease the magic points by the cost of spell player.Magic -= currentSpell[i].MPCost; } break; } } } }
private void ChangeMap2(eButtonState buttonState) { if (buttonState == eButtonState.DOWN) { world.ChangeMap("Room1"); } }
public void OnStopGame(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.PRESSED) { Exit(); } }
private void ChangeScreen(eButtonState buttonstate) { if (buttonstate == eButtonState.DOWN) { ScreenManager.Instance.ChangeScreens("TitleScreen"); } }
public void Jump(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { isJumping = true; } }
private void MakePlayerShoot(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.PRESSED) { level.MakePlayerShoot(); } }
public void MoveRight(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN || buttonState == eButtonState.PRESSED) { playerController.MoveRight(1.0f); } }
private void OnGoToNextScreen(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.PRESSED) { nextScreenCalled++; spacePressed = true; } }
void SetState(eButtonState state) { if (State != state) { TimeInState = 0; } State = state; }
public void EnterNumber9(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN && special > 0) { special--; playerController.SpecialAttack(9); } }
// push button event handler. callback fuction. void PushButton(GameObject ButtonPressed) { if (ButtonPressed == transform.parent.gameObject){ if (!Disabled){ if(State == eButtonState.Off){ State = eButtonState.On; } else{ State = eButtonState.Off; } } cMessenger<MonoBehaviour>.Invoke("linkedButton", this); }; }
//**関数*************************************************************************** // 概要 : 状態変更 //********************************************************************************* public void SetState(eButtonState eButtonState) { m_nState = (int)eButtonState; switch (eButtonState) { case eButtonState.DEFAULT: gameObject.GetComponent<CObj2D>().SetColor(DEFAULT_COLOR); break; case eButtonState.ACTIVE: gameObject.GetComponent<CObj2D>().SetColor(ACTIVE_COLOR); break; case eButtonState.UNUSE: gameObject.GetComponent<CObj2D>().SetColor(UNUSE_COLOR); break; default: Debug.Log("CButton Set State Error"); break; } }
public void Down(eButtonState buttonState, Vector2 amount) { if (buttonState == eButtonState.DOWN) { playerSprite.Velocity += new Vector2(0, 1); } else { playerSprite.Velocity += new Vector2(0, 0); } }
//-------------------------------------------------------------------------------- protected override void OnMouseEnter(System.EventArgs e) { m_State = eButtonState.MouseOver; this.Invalidate(); base.OnMouseEnter(e); }
//-------------------------------------------------------------------------------- protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) { m_State = eButtonState.Down; this.Invalidate(); base.OnMouseDown(e); }
//-------------------------------------------------------------------------------- protected override void OnMouseDown(MouseEventArgs e) { m_State = eButtonState.Down; Invalidate(); base.OnMouseDown(e); }
//-------------------------------------------------------------------------------- protected override void OnMouseUp(MouseEventArgs e) { m_State = eButtonState.MouseOver; Invalidate(); base.OnMouseUp(e); }
//-------------------------------------------------------------------------------- protected override void OnMouseLeave(EventArgs e) { m_State = eButtonState.Normal; Invalidate(); base.OnMouseLeave(e); }