internal virtual void OnButtonPressed(GameplayAction key) { if (key == this.key) { keyIsBeingPressed = true; } }
internal virtual void OnButtonReleased(GameplayAction key) { if (key == this.key) { keyIsBeingPressed = false; } }
internal void SetAction(GameplayAction action) { var image = button.GetComponentsInChildren <Image>(true)[1]; image.sprite = GameLocalisation.Instance.GetGameplayActionSprite(action); image.color = GameLocalisation.Instance.GetGameplayActionColor(action); }
internal override void OnButtonReleased(GameplayAction key) { //if (key == this.key) //{ // keyIsBeingPressed = false; //} }
internal override void OnButtonPressed(GameplayAction key) { if (key == this.key) { goingTowardsMaximumRotation = !goingTowardsMaximumRotation; isCurrentlyMoving = true; } }
private void OnButtonPressed(GameplayAction key) { switch (key) { case GameplayAction.ArenaPause: if (!gameplayIsPaused) { if (CheatGetMainMenu != null) { CheatGetMainMenu.ShowSequence(); } //Time.timeScale = 0f; foreach (IGameplayPausable pausable in GetComponentsInChildren <IGameplayPausable>()) { pausable.SetPaused(true); } gameplayIsPaused = true; } else { if (CheatGetMainMenu != null) { CheatGetMainMenu.SetActive(false); } //Time.timeScale = 1f; foreach (IGameplayPausable pausable in GetComponentsInChildren <IGameplayPausable>()) { pausable.SetPaused(false); } gameplayIsPaused = false; } break; case GameplayAction.ArenaNext: NextArena(); break; case GameplayAction.ArenaPrevious: PreviousArena(); break; case GameplayAction.ArenaShake: ShakeArena(); break; case GameplayAction.DebugKey: Debug.Log($"{key}"); break; case GameplayAction.DebugSpawnBall: // Shouldnt use this input here, just for debugging currentlyActiveArena.SpawnBall(); break; default: break; } }
public Sprite GetGameplayActionSprite(GameplayAction action, bool buttonPressedDownVersion = false) { Sprite sprite = null; switch (action) { case GameplayAction.DebugKey: break; case GameplayAction.LeftMain: sprite = sprites[0]; break; case GameplayAction.RightMain: sprite = sprites[1]; break; case GameplayAction.LeftSpecial: sprite = sprites[2]; break; case GameplayAction.RightSpecial: sprite = sprites[3]; break; case GameplayAction.ArenaPause: sprite = sprites[4]; break; case GameplayAction.ArenaNext: sprite = sprites[5]; break; case GameplayAction.ArenaPrevious: sprite = sprites[6]; break; case GameplayAction.ArenaShake: if (buttonPressedDownVersion) { sprite = sprites[8]; } else { sprite = sprites[7]; } break; case GameplayAction.DebugSpawnBall: sprite = sprites[9]; break; default: break; } return(sprite); }
public Color GetGameplayActionColor(GameplayAction action) { Color color = Color.white; switch (action) { case GameplayAction.DebugKey: break; case GameplayAction.LeftMain: color = colors[0]; break; case GameplayAction.RightMain: color = colors[1]; break; case GameplayAction.LeftSpecial: color = colors[2]; break; case GameplayAction.RightSpecial: color = colors[3]; break; case GameplayAction.ArenaPause: color = colors[4]; break; case GameplayAction.ArenaNext: color = colors[5]; break; case GameplayAction.ArenaPrevious: color = colors[6]; break; case GameplayAction.ArenaShake: color = colors[7]; break; case GameplayAction.DebugSpawnBall: color = colors[8]; break; default: break; } return(color); }
private void OnButtonReleased(GameplayAction key) { if (key == this.key) { if (keyButtonPressedParticleSystem != null) { keyButtonPressedParticleSystem.Stop(); } if (keyButtonUnpressedParticleSystem) { keyButtonUnpressedParticleSystem.Play(); } } }
private void SetActive(GameplayAction key) { //if (key == GameplayAction.ActivateMagneticField) // isActive = true; //else if (key == GameplayAction.DeactivateMagneticField) if (key == GameplayAction.RightSpecial) { if (isActive) { ReleaseAllCaughtObjects(); } isActive = !isActive; } }
internal void SetKey(GameplayAction newKey) { key = newKey; UpdateParticleMaterial(); }
internal void BroadcastButtonReleased(GameplayAction key) { OnBroadcastButtonReleased?.Invoke(key); }