public void SetSuicideEnabled(bool enabled, bool gameplayReason = false) { if (Suicide != null) { if (gameplayReason) { SuicideEnabled = enabled; } Suicide.interactable = enabled; if (SuicideBCSH == null) { SuicideBCSH = Suicide.GetComponent <BCSHModifier>(); } if (SuicideBCSH != null) { if (enabled) { SuicideBCSH.ApplyBCSHState("default"); } else { SuicideBCSH.ApplyBCSHState("disabled"); } } } }
void ResetPowerUp() { switch (_currentPowerUp) { case PowerUpType.E_SPEED_UP: { _moveForcePowerUp = 0f; _animator["walk"].speed = 2.0f; break; } case PowerUpType.E_ANGRY: { _moveForcePowerUp = 0f; _animator["walk"].speed = 2.0f; if (HeadBCSH != null) { HeadBCSH.ApplyBCSHState("default"); } break; } case PowerUpType.E_INVINCIBLE: { _moveForcePowerUp = 0f; _animator["walk"].speed = 2.0f; for (var i = 0; i < _playerMaterials.Count; ++i) { _colorTemp = Color.white; _colorTemp.a = 1f; _playerMaterials[i].SetColor("_Color", _colorTemp); } break; } } if (_sceneManager.PowerUpTime != null) { _sceneManager.PowerUpTime.SetEnabled(false); } _currentPowerUp = PowerUpType.E_NONE; }
public void SetTurnEnabled(bool enabled) { if (TurnBack != null) { TurnBack.interactable = enabled; if (TurnBackBCSH == null) { TurnBackBCSH = TurnBack.GetComponent <BCSHModifier>(); } if (TurnBackBCSH != null) { if (enabled) { TurnBackBCSH.ApplyBCSHState("default"); } else { TurnBackBCSH.ApplyBCSHState("disabled"); } } } if (TurnForward != null) { TurnForward.interactable = enabled; if (TurnForwardBCSH == null) { TurnForwardBCSH = TurnForward.GetComponent <BCSHModifier>(); } if (TurnForwardBCSH != null) { if (enabled) { TurnForwardBCSH.ApplyBCSHState("default"); } else { TurnForwardBCSH.ApplyBCSHState("disabled"); } } } }
public void ShowPowerUpTime(CP_PlayerController.PowerUpType powerUpType) { if (TimeBCSH != null) { switch (powerUpType) { case CP_PlayerController.PowerUpType.E_ANGRY: { TimeBCSH.ApplyBCSHState("angry"); Text.text = "A"; break; } case CP_PlayerController.PowerUpType.E_INVINCIBLE: { TimeBCSH.ApplyBCSHState("invincible"); Text.text = "I"; break; } case CP_PlayerController.PowerUpType.E_SPEED_UP: { TimeBCSH.ApplyBCSHState("speedup"); Text.text = "S"; break; } case CP_PlayerController.PowerUpType.E_DOUBLE_JUMP: { TimeBCSH.ApplyBCSHState("doublejump"); Text.text = "D"; break; } } } SetEnabled(true); }