From 6fe34d8eec663c889f38d5cfb144f190b4ea5218 Mon Sep 17 00:00:00 2001 From: "skrwns304@gmail.com" Date: Mon, 15 Jun 2026 15:29:54 +0900 Subject: [PATCH] =?UTF-8?q?2026-06-15=20=EB=A6=AC=EB=93=AC=EA=B2=8C?= =?UTF-8?q?=EC=9E=84=20=ED=94=84=EB=A1=9C=ED=86=A0=ED=83=80=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WhaleAdventure_VR/Rooms/CatsRoom.unity | 4 +- .../02_Scripts/Data/Rhythm/MidiChartParser.cs | 7 ++ .../Managers/CatsRoom/RhythmManager.cs | 42 +++++++--- Assets/02_Scripts/Managers/InputManager.cs | 16 ++++ Assets/02_Scripts/Rhythm/RhythmNoteSpawner.cs | 29 ++++++- .../04_Models/Note/Prefabs/MusicNote_L.prefab | 3 + .../Note/Prefabs/MusicNote_L.prefab.meta | 8 ++ .../04_Models/Note/Prefabs/MusicNote_R.prefab | 3 + .../Note/Prefabs/MusicNote_R.prefab.meta | 8 ++ Assets/07_Data/Rhythm/Song1.meta | 8 ++ Assets/07_Data/Rhythm/Song1/RhythmSong1.asset | 3 + .../Rhythm/{ => Song1}/RhythmSong1.asset.meta | 0 Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes | Bin 0 -> 6874 bytes .../Rhythm/Song1/Song1_Mid.bytes.meta} | 2 +- Assets/10_FX/SFX/SFX_Snare_Edit.wav | 3 + Assets/10_FX/SFX/SFX_Snare_Edit.wav.meta | 23 ++++++ Assets/10_FX/SFX/dumy.txt | 1 - .../Source/Music/낭만고양이_채보_84.wav | 3 + ...양이.wav.meta => 낭만고양이_채보_84.wav.meta} | 2 +- Assets/99_Settings/Input/GameInput.cs | 78 ++++++++++++++++++ .../99_Settings/Input/GameInput.inputactions | 40 +++++++++ Assets/DefaultVolumeProfile.asset | 4 +- ProjectSettings/AudioManager.asset | 4 +- 23 files changed, 265 insertions(+), 26 deletions(-) create mode 100644 Assets/04_Models/Note/Prefabs/MusicNote_L.prefab create mode 100644 Assets/04_Models/Note/Prefabs/MusicNote_L.prefab.meta create mode 100644 Assets/04_Models/Note/Prefabs/MusicNote_R.prefab create mode 100644 Assets/04_Models/Note/Prefabs/MusicNote_R.prefab.meta create mode 100644 Assets/07_Data/Rhythm/Song1.meta create mode 100644 Assets/07_Data/Rhythm/Song1/RhythmSong1.asset rename Assets/07_Data/Rhythm/{ => Song1}/RhythmSong1.asset.meta (100%) create mode 100644 Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes rename Assets/{10_FX/SFX/dumy.txt.meta => 07_Data/Rhythm/Song1/Song1_Mid.bytes.meta} (75%) create mode 100644 Assets/10_FX/SFX/SFX_Snare_Edit.wav create mode 100644 Assets/10_FX/SFX/SFX_Snare_Edit.wav.meta delete mode 100644 Assets/10_FX/SFX/dumy.txt create mode 100644 Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav rename Assets/11_Audio/Source/Music/{낭만 고양이.wav.meta => 낭만고양이_채보_84.wav.meta} (91%) diff --git a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity index 771dbefd..8aa3cbc1 100644 --- a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity +++ b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bf233d545596bc310da144b6a8935ddbd486528e791c1431adee908a17901b24 -size 2042631 +oid sha256:7a45a2e4631c5ca5aa368fe8bc42d2deeae12799e34377d20e0a6f4ff393e47a +size 2045764 diff --git a/Assets/02_Scripts/Data/Rhythm/MidiChartParser.cs b/Assets/02_Scripts/Data/Rhythm/MidiChartParser.cs index afeb8150..0bbcd3ce 100644 --- a/Assets/02_Scripts/Data/Rhythm/MidiChartParser.cs +++ b/Assets/02_Scripts/Data/Rhythm/MidiChartParser.cs @@ -114,6 +114,13 @@ public static List Parse(byte[] data, float offset, float bpmOverride, Lis p = trackEnd; // 트랙 경계 보정 } + // [임시 디버그] MIDI에 실제로 들어있는 고유 음높이 확인 (LanePitches 번호 맞춘 뒤 삭제) + var uniquePitches = new HashSet(); + foreach (var raw in rawNotes) uniquePitches.Add(raw.pitch); + var sortedPitches = new List(uniquePitches); + sortedPitches.Sort(); + Debug.Log($"[MidiChartParser] 발견된 고유 pitch: {string.Join(", ", sortedPitches)} (노트 {rawNotes.Count}개)"); + // ---- 틱 → 초 변환 ---- double usPerQuarter = bpmOverride > 0f ? 60000000.0 / bpmOverride diff --git a/Assets/02_Scripts/Managers/CatsRoom/RhythmManager.cs b/Assets/02_Scripts/Managers/CatsRoom/RhythmManager.cs index 881c40d4..b1f3b77c 100644 --- a/Assets/02_Scripts/Managers/CatsRoom/RhythmManager.cs +++ b/Assets/02_Scripts/Managers/CatsRoom/RhythmManager.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Hovl; using UnityEngine; using UnityEngine.InputSystem; @@ -10,20 +9,26 @@ public class RhythmManager : MonoBehaviour [SerializeField] private AudioSource _audioSource; [SerializeField] private RhythmChart _currentChart; [SerializeField] private RhythmNoteSpawner _spawner; - [SerializeField] private float _leadTime = 2f; // 노트가 생성돼 판정선까지 흐르는 시간(초) + [SerializeField] private float _leadTime = 1f; // 노트가 생성돼 판정선까지 흐르는 시간(초) [Header("판정 윈도우 (초, 절대 시간차 기준)")] [SerializeField] private float _perfectWindow = 0.05f; [SerializeField] private float _goodWindow = 0.10f; [SerializeField] private float _badWindow = 0.15f; // 이 밖이면 입력 무시(헛침) + [Header("효과음")] + [SerializeField] private AudioClip _hitSfx; // 내려칠 때마다 재생 (판정과 무관, 헛침 포함) + [SerializeField] private GameObject StartButtonObj; - public float SongTime => _audioSource.time; // 모든 타이밍의 기준 + // 모든 타이밍의 기준. 오디오 클럭(dspTime) 기반이라 리드인 동안 음수(-leadTime→0)로 흐른다 + public float SongTime => (float)(AudioSettings.dspTime - _dspSongStart); private List SongNoteList; private int _nextNoteIndex; // 다음에 소환할 노트 인덱스 private bool _isPlaying; //곡이 재생 중인지 (종료 감지용) + private double _dspSongStart; // 오디오가 실제 시작되는 dsp 시각 (= SongTime 0 지점) + private float _clipLength; // 곡 길이 캐시 (종료 감지용) private Func _songTimeProvider; // 노트에 넘길 시간 제공자 (매 스폰마다 람다 재생성 방지용 캐시) private readonly List _activeNotes = new(); // 화면에 떠 있는(아직 처리 안 된) 노트들 @@ -43,24 +48,23 @@ private void Awake() private void Start() { ChangeSong(); + + InputManager.Instance.OnKey_Left_Event += OnPlayerInput; + InputManager.Instance.OnKey_Right_Event += OnPlayerInput; } private void Update() { - //재생 중이던 곡이 끝나면 주변음 복구 - if (_isPlaying && !_audioSource.isPlaying) + if (!_isPlaying) return; + + //곡이 끝나면(리드인 지나 곡 길이 도달) 정지·주변음 복구 + if (SongTime >= _clipLength) { StopSong(); return; } - if (!_isPlaying) return; - SpawnDueNotes(); - - // 테스트용: 스페이스로 판정 (실제 VR에서는 컨트롤러/콜라이더 입력으로 교체) - if (Keyboard.current != null && Keyboard.current.spaceKey.wasPressedThisFrame) - OnPlayerInput(); } // SongTime 기준으로 소환할 때가 된 노트들을 순서대로 생성 @@ -95,7 +99,13 @@ public void StartSong() OnScoreChanged?.Invoke(Score); // HUD 초기화(0점) StartButtonObj.SetActive(false); - _audioSource.Play(); + _clipLength = _audioSource.clip != null ? _audioSource.clip.length : 0f; + + // 리드인: 지금부터 _leadTime 뒤에 오디오 시작. + // 그 사이 SongTime이 -_leadTime→0으로 흘러 첫 노트(0초 부근)도 충분히 날아온다 + _dspSongStart = AudioSettings.dspTime + _leadTime; + _audioSource.PlayScheduled(_dspSongStart); + _isPlaying = true; //BGM·환경음을 낮춰 리듬게임 소리만 들리게 @@ -125,7 +135,13 @@ private void OnNoteMissed(RhythmNoteInstance note) public void OnPlayerInput() { - if (!_isPlaying || _activeNotes.Count == 0) return; + if (!_isPlaying) return; + + // 판정과 무관하게 내려칠 때마다 효과음 (헛침 포함) + if (_hitSfx != null && SoundManager.Instance != null) + SoundManager.Instance.PlaySFX(_hitSfx); + + if (_activeNotes.Count == 0) return; // 판정선에 가장 가까운(시간차 최소) 노트 탐색 RhythmNoteInstance target = null; diff --git a/Assets/02_Scripts/Managers/InputManager.cs b/Assets/02_Scripts/Managers/InputManager.cs index 62ab7b2e..7b754a30 100644 --- a/Assets/02_Scripts/Managers/InputManager.cs +++ b/Assets/02_Scripts/Managers/InputManager.cs @@ -11,6 +11,10 @@ public class InputManager : MonoBehaviour, GameInput.IPlayerActions // ─── 입력 이벤트들 (PlayerController 등이 구독) ────────────────────── public event Action OnJump_Event; // 한 번씩 (눌렀을 때) + + //키보드로 테스트용 + public event Action OnKey_Left_Event; + public event Action OnKey_Right_Event; private void Awake() { @@ -39,4 +43,16 @@ public void OnJump(InputAction.CallbackContext ctx) if (ctx.phase == InputActionPhase.Started) OnJump_Event?.Invoke(); } + + public void OnKey_Left(InputAction.CallbackContext ctx) + { + if (ctx.phase == InputActionPhase.Started) + OnKey_Left_Event?.Invoke(); + } + + public void OnKey_Right(InputAction.CallbackContext ctx) + { + if (ctx.phase == InputActionPhase.Started) + OnKey_Right_Event?.Invoke(); + } } diff --git a/Assets/02_Scripts/Rhythm/RhythmNoteSpawner.cs b/Assets/02_Scripts/Rhythm/RhythmNoteSpawner.cs index 721b6e9d..135d05cf 100644 --- a/Assets/02_Scripts/Rhythm/RhythmNoteSpawner.cs +++ b/Assets/02_Scripts/Rhythm/RhythmNoteSpawner.cs @@ -3,17 +3,38 @@ public class RhythmNoteSpawner : MonoBehaviour { - [SerializeField] private RhythmNoteInstance _notePrefab; // 생성할 노트 프리팹 + // 레인(손)별 설정 - 전용 프리팹 + 가로 위치 오프셋 + [Serializable] + public class LaneVisual + { + public RhythmNoteInstance Prefab; // 이 레인 전용 노트 프리팹 (왼손/오른손 다른 모양) + public Vector3 Offset; // 스폰/판정 위치 가로 오프셋 (왼손 -x, 오른손 +x 등) + } + + [SerializeField] private RhythmNoteInstance _notePrefab; // 기본 프리팹 (레인 전용 미지정 시 사용) [SerializeField] private Transform _spawnPoint; // 노트가 생겨나는 위치(미지정 시 자기 위치) [SerializeField] private Transform _judgmentLine; // 목적지(판정선) + [SerializeField] private LaneVisual[] _lanes; // 인덱스 = Note.Lane (RhythmChart.LanePitches 순서와 일치) - // 노트 프리팹 생성, 목적지·타이밍 주입 + // 노트 생성, 목적지·타이밍 주입. 레인에 따라 프리팹/위치만 다르게(판정은 동일) public RhythmNoteInstance SpawnNote(Note note, float spawnTime, Func songTime, Action onMiss = null) { Transform origin = _spawnPoint != null ? _spawnPoint : transform; - RhythmNoteInstance instance = Instantiate(_notePrefab, origin.position, origin.rotation, transform); - instance.Setup(origin.position, _judgmentLine.position, spawnTime, note.Time, songTime, onMiss); + + // 레인 범위 밖이면 기본 프리팹/오프셋 0 + LaneVisual lane = (_lanes != null && note.Lane >= 0 && note.Lane < _lanes.Length) + ? _lanes[note.Lane] : null; + + RhythmNoteInstance prefab = (lane != null && lane.Prefab != null) ? lane.Prefab : _notePrefab; + + // 오프셋을 origin 방향 기준으로 적용해 레인을 평행 이동(start·target 동일 오프셋이라 경로가 곧음) + Vector3 worldOffset = lane != null ? origin.rotation * lane.Offset : Vector3.zero; + Vector3 start = origin.position + worldOffset; + Vector3 target = _judgmentLine.position + worldOffset; + + RhythmNoteInstance instance = Instantiate(prefab, start, origin.rotation, transform); + instance.Setup(start, target, spawnTime, note.Time, songTime, onMiss); return instance; } } diff --git a/Assets/04_Models/Note/Prefabs/MusicNote_L.prefab b/Assets/04_Models/Note/Prefabs/MusicNote_L.prefab new file mode 100644 index 00000000..a8523ff8 --- /dev/null +++ b/Assets/04_Models/Note/Prefabs/MusicNote_L.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d1c09065047cd6d8100b5aa633eac1ee86674d66a97859b9752f99ca3ebc317 +size 134294 diff --git a/Assets/04_Models/Note/Prefabs/MusicNote_L.prefab.meta b/Assets/04_Models/Note/Prefabs/MusicNote_L.prefab.meta new file mode 100644 index 00000000..23eee458 --- /dev/null +++ b/Assets/04_Models/Note/Prefabs/MusicNote_L.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24bc7742b39f0084ba058c0192831c60 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Note/Prefabs/MusicNote_R.prefab b/Assets/04_Models/Note/Prefabs/MusicNote_R.prefab new file mode 100644 index 00000000..507beaca --- /dev/null +++ b/Assets/04_Models/Note/Prefabs/MusicNote_R.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af1fda23181533186ffe8536c39c292c85b0e0662c982c0b6c884f1c99ef21ac +size 134275 diff --git a/Assets/04_Models/Note/Prefabs/MusicNote_R.prefab.meta b/Assets/04_Models/Note/Prefabs/MusicNote_R.prefab.meta new file mode 100644 index 00000000..66ca7204 --- /dev/null +++ b/Assets/04_Models/Note/Prefabs/MusicNote_R.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ef8d383193e61348839e50435858283 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/07_Data/Rhythm/Song1.meta b/Assets/07_Data/Rhythm/Song1.meta new file mode 100644 index 00000000..d88ace0b --- /dev/null +++ b/Assets/07_Data/Rhythm/Song1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be648995dc31d5b4c99f30f39c048eca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/07_Data/Rhythm/Song1/RhythmSong1.asset b/Assets/07_Data/Rhythm/Song1/RhythmSong1.asset new file mode 100644 index 00000000..1171e2ef --- /dev/null +++ b/Assets/07_Data/Rhythm/Song1/RhythmSong1.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa626c745be0b97b1543b4de1d1aefbb53dc504f626929787c94d22ea720f273 +size 653 diff --git a/Assets/07_Data/Rhythm/RhythmSong1.asset.meta b/Assets/07_Data/Rhythm/Song1/RhythmSong1.asset.meta similarity index 100% rename from Assets/07_Data/Rhythm/RhythmSong1.asset.meta rename to Assets/07_Data/Rhythm/Song1/RhythmSong1.asset.meta diff --git a/Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes b/Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes new file mode 100644 index 0000000000000000000000000000000000000000..b5c64fb5b03950a9e48b631bd3a27641782cec58 GIT binary patch literal 6874 zcmeHMF-}`S5FKL!7NL*nQqtigxI##Q0znZ`fn-aTLZk!=Na+wHBr5JedjA`clK@BH z1ZL6xhyCB|X#X1Wg@~)~nRz?&=IxA)@z!p?Dd0`hD|h0aJ&~bHJ6u>U_-~wRn$X$pj(x6X zhsIo29-g?aZ+`mR`*|#x0I{n7Z=U^ z#RffFxh+?x?!;+FO4=Jaew@#rw{6d;m7hc1SsvEK>p0WN>!Rm_^|EmP%RGklz<%*w zv!1DQ#`v;zxURO*hkt6`h+{ushw;o4?@R3GI_L*aD_+)b;ZpN+9=5r!*S0PFEPrZ! zJCAk0VZWV+=O)c&y)C<)e}1O+|8jg-4~r*0=PkYTe)9XNugARYd|^DFPqj7Aa2<^+ z+YjT4w&okYhj{&B-uH&rI{AL_J{XHvuLtI+s{2GeuS?tbdmK7pf3e?|A2{qKp1?!@ zs{G&!UZ{^J;@}4y{ID4hKhFvB0MBu|@8Uk%ppg>6D zrp+^5e!dX4Q~9AU7BXh1*3tNI|GFQK!T7pJI?#GiQIX5$*{sY&s)b8C(fQ^-$!f{Q{#LO@81sV zSbg8G!viZB=O3;Yo0oWAKfjpU89q&q>h%xL0q&3aSboN_UHu$beWl&U%Xz;Q9{;-U aaG#iiv5uYxzEb@8VgCqIvqMim{5%397mE=9 literal 0 HcmV?d00001 diff --git a/Assets/10_FX/SFX/dumy.txt.meta b/Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes.meta similarity index 75% rename from Assets/10_FX/SFX/dumy.txt.meta rename to Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes.meta index 5fce1c82..5cafd642 100644 --- a/Assets/10_FX/SFX/dumy.txt.meta +++ b/Assets/07_Data/Rhythm/Song1/Song1_Mid.bytes.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8a4a85f29dd93ba4cbb7bbfc3aedcfee +guid: 4b989a765a23e6748b978c76d50ab315 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/10_FX/SFX/SFX_Snare_Edit.wav b/Assets/10_FX/SFX/SFX_Snare_Edit.wav new file mode 100644 index 00000000..8c2e1e0d --- /dev/null +++ b/Assets/10_FX/SFX/SFX_Snare_Edit.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c85a70a9c8d70a07e03aff1f5aa1d133a6efdbf8bdb42abc3e0b7d2b919ef390 +size 38580 diff --git a/Assets/10_FX/SFX/SFX_Snare_Edit.wav.meta b/Assets/10_FX/SFX/SFX_Snare_Edit.wav.meta new file mode 100644 index 00000000..fe94313e --- /dev/null +++ b/Assets/10_FX/SFX/SFX_Snare_Edit.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0e08aeecbf5318f48b313c36c73fec53 +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 0 + quality: 1 + conversionMode: 0 + preloadAudioData: 1 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/10_FX/SFX/dumy.txt b/Assets/10_FX/SFX/dumy.txt deleted file mode 100644 index 34b4a496..00000000 --- a/Assets/10_FX/SFX/dumy.txt +++ /dev/null @@ -1 +0,0 @@ -지울것 \ No newline at end of file diff --git a/Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav b/Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav new file mode 100644 index 00000000..45ce7989 --- /dev/null +++ b/Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c21c94fce7668991716d80424a56f6380aa6e86040313fc6aaabead1b48b82b +size 40291340 diff --git a/Assets/11_Audio/Source/Music/낭만 고양이.wav.meta b/Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav.meta similarity index 91% rename from Assets/11_Audio/Source/Music/낭만 고양이.wav.meta rename to Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav.meta index b55f23c2..729012a5 100644 --- a/Assets/11_Audio/Source/Music/낭만 고양이.wav.meta +++ b/Assets/11_Audio/Source/Music/낭만고양이_채보_84.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d6b71773bcf77be4bbf06915c1cabb06 +guid: bfc25b7b5f6b3bd49a801d28d4367354 AudioImporter: externalObjects: {} serializedVersion: 8 diff --git a/Assets/99_Settings/Input/GameInput.cs b/Assets/99_Settings/Input/GameInput.cs index de2e319d..317ea553 100644 --- a/Assets/99_Settings/Input/GameInput.cs +++ b/Assets/99_Settings/Input/GameInput.cs @@ -100,6 +100,24 @@ public @GameInput() ""processors"": """", ""interactions"": """", ""initialStateCheck"": false + }, + { + ""name"": ""Key_Left"", + ""type"": ""Button"", + ""id"": ""5afd9129-22e8-4e22-9843-f936922fc2a9"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Key_Right"", + ""type"": ""Button"", + ""id"": ""5d342104-f81c-46cf-af37-f9388136115b"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false } ], ""bindings"": [ @@ -113,6 +131,28 @@ public @GameInput() ""action"": ""Jump"", ""isComposite"": false, ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""8de0c981-8048-4b3e-baf8-d77cf3dbcc39"", + ""path"": ""/leftArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Key_Left"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""e2dedd13-89db-4921-8a87-303eaded5f2e"", + ""path"": ""/rightArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Key_Right"", + ""isComposite"": false, + ""isPartOfComposite"": false } ] } @@ -122,6 +162,8 @@ public @GameInput() // Player m_Player = asset.FindActionMap("Player", throwIfNotFound: true); m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true); + m_Player_Key_Left = m_Player.FindAction("Key_Left", throwIfNotFound: true); + m_Player_Key_Right = m_Player.FindAction("Key_Right", throwIfNotFound: true); } ~@GameInput() @@ -203,6 +245,8 @@ public int FindBinding(InputBinding bindingMask, out InputAction action) private readonly InputActionMap m_Player; private List m_PlayerActionsCallbackInterfaces = new List(); private readonly InputAction m_Player_Jump; + private readonly InputAction m_Player_Key_Left; + private readonly InputAction m_Player_Key_Right; /// /// Provides access to input actions defined in input action map "Player". /// @@ -219,6 +263,14 @@ public struct PlayerActions /// public InputAction @Jump => m_Wrapper.m_Player_Jump; /// + /// Provides access to the underlying input action "Player/Key_Left". + /// + public InputAction @Key_Left => m_Wrapper.m_Player_Key_Left; + /// + /// Provides access to the underlying input action "Player/Key_Right". + /// + public InputAction @Key_Right => m_Wrapper.m_Player_Key_Right; + /// /// Provides access to the underlying input action map instance. /// public InputActionMap Get() { return m_Wrapper.m_Player; } @@ -247,6 +299,12 @@ public void AddCallbacks(IPlayerActions instance) @Jump.started += instance.OnJump; @Jump.performed += instance.OnJump; @Jump.canceled += instance.OnJump; + @Key_Left.started += instance.OnKey_Left; + @Key_Left.performed += instance.OnKey_Left; + @Key_Left.canceled += instance.OnKey_Left; + @Key_Right.started += instance.OnKey_Right; + @Key_Right.performed += instance.OnKey_Right; + @Key_Right.canceled += instance.OnKey_Right; } /// @@ -261,6 +319,12 @@ private void UnregisterCallbacks(IPlayerActions instance) @Jump.started -= instance.OnJump; @Jump.performed -= instance.OnJump; @Jump.canceled -= instance.OnJump; + @Key_Left.started -= instance.OnKey_Left; + @Key_Left.performed -= instance.OnKey_Left; + @Key_Left.canceled -= instance.OnKey_Left; + @Key_Right.started -= instance.OnKey_Right; + @Key_Right.performed -= instance.OnKey_Right; + @Key_Right.canceled -= instance.OnKey_Right; } /// @@ -308,5 +372,19 @@ public interface IPlayerActions /// /// void OnJump(InputAction.CallbackContext context); + /// + /// Method invoked when associated input action "Key_Left" is either , or . + /// + /// + /// + /// + void OnKey_Left(InputAction.CallbackContext context); + /// + /// Method invoked when associated input action "Key_Right" is either , or . + /// + /// + /// + /// + void OnKey_Right(InputAction.CallbackContext context); } } diff --git a/Assets/99_Settings/Input/GameInput.inputactions b/Assets/99_Settings/Input/GameInput.inputactions index 014e3192..855e0454 100644 --- a/Assets/99_Settings/Input/GameInput.inputactions +++ b/Assets/99_Settings/Input/GameInput.inputactions @@ -14,6 +14,24 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "Key_Left", + "type": "Button", + "id": "5afd9129-22e8-4e22-9843-f936922fc2a9", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Key_Right", + "type": "Button", + "id": "5d342104-f81c-46cf-af37-f9388136115b", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -27,6 +45,28 @@ "action": "Jump", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "8de0c981-8048-4b3e-baf8-d77cf3dbcc39", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": "", + "action": "Key_Left", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e2dedd13-89db-4921-8a87-303eaded5f2e", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": "", + "action": "Key_Right", + "isComposite": false, + "isPartOfComposite": false } ] } diff --git a/Assets/DefaultVolumeProfile.asset b/Assets/DefaultVolumeProfile.asset index 8074f272..f0ec91e3 100644 --- a/Assets/DefaultVolumeProfile.asset +++ b/Assets/DefaultVolumeProfile.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f45f0412be07fc53fb16b99971c573af991567cc297324983771c19c30aa52ef -size 18719 +oid sha256:53171b120a7a23d6572ec85443f873ce9fb4cf95efc5867abdf4b24f9d2be0da +size 19939 diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset index c3f6f121..0e97351e 100644 --- a/ProjectSettings/AudioManager.asset +++ b/ProjectSettings/AudioManager.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f2ed914f70919b6434c647bd820850be731b408f0f0c31e3bf7f98c8cafb617f -size 416 +oid sha256:0767cdd8001b92d234bd6082159bbe74b21f7f96954485dee5629730f783c052 +size 524