ピッチ設定を追加
This commit is contained in:
parent
97704c47b7
commit
89f2cef063
|
|
@ -33,6 +33,9 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
[SerializeField] private GameObject readyObject;
|
||||
[SerializeField] private GameObject tutorialPopupObject;
|
||||
[SerializeField] private float resultWaitTime = 1f;
|
||||
[SerializeField] private float normalPitch = 1.1f;
|
||||
[SerializeField] private float hardPitch = 1.2f;
|
||||
[SerializeField] private float extraPitch = 1.4f;
|
||||
#if UNITY_EDITOR
|
||||
[SerializeField] private bool isDebug;
|
||||
#endif
|
||||
|
|
@ -159,8 +162,11 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
SoundManager.Instance.PlaySE("se_minigame_Start");
|
||||
break;
|
||||
case GameState.Success:
|
||||
SoundManager.Instance.PlaySE("se_minigame_End");
|
||||
player.Result();
|
||||
SoundManager.Instance.PlaySE("se_minigame_End", () =>
|
||||
{
|
||||
SoundManager.Instance.ChangePitchBGM(1f);
|
||||
player.Result();
|
||||
});
|
||||
break;
|
||||
case GameState.Failure:
|
||||
break;
|
||||
|
|
@ -210,6 +216,15 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
{
|
||||
bgManager.SetSky(x);
|
||||
player.SetSpeed(x);
|
||||
var pitch = x switch
|
||||
{
|
||||
ScrollGameDifficulty.Easy => 1f,
|
||||
ScrollGameDifficulty.Normal => normalPitch,
|
||||
ScrollGameDifficulty.Hard => hardPitch,
|
||||
ScrollGameDifficulty.Extra => extraPitch,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(x), x, null)
|
||||
};
|
||||
SoundManager.Instance.ChangePitchBGM(pitch);
|
||||
}).AddTo(this);
|
||||
|
||||
player.OnEndHit.Subscribe(_ =>
|
||||
|
|
@ -217,13 +232,6 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
state.Value = GameState.Success;
|
||||
}).AddTo(this);
|
||||
|
||||
player.CurrentSpeedMultiply.SkipLatestValueOnSubscribe()
|
||||
.Where(_ => state.Value == GameState.Play)
|
||||
.Subscribe(x =>
|
||||
{
|
||||
SoundManager.Instance.ChangePitchBGM(x);
|
||||
}).AddTo(this);
|
||||
|
||||
player.OnHitItem.Where(_ => state.Value == GameState.Play).Subscribe(x =>
|
||||
{
|
||||
if (!x.TryGetComponent<StageItem>(out var item))
|
||||
|
|
@ -272,6 +280,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
|||
{
|
||||
case StageItem.Type.Obstacle:
|
||||
player.Hit(closestPoint);
|
||||
SoundManager.Instance.ChangePitchBGM(0f);
|
||||
break;
|
||||
case StageItem.Type.Item1:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue