From f0df7736f4e3f7339bcce5eb09e190f27bf64c8b Mon Sep 17 00:00:00 2001 From: ohgushiyuga Date: Thu, 23 Jul 2026 16:30:29 +0900 Subject: [PATCH] codingmosaku --- .../XR/Settings/OpenXRPackageSettings.asset | 6 +- Assets/_Scenes/GameScene.unity | 303 ++++++++++++++++-- Assets/_Scripts/CodingModeManager.cs | 108 ------- Assets/_Scripts/CodingModeManager.cs.meta | 2 - Assets/_Scripts/PlayerStatusManager.cs | 36 +-- Assets/_Scripts/PuzzleBlock.cs | 203 +++++++----- Assets/_Scripts/PuzzleGridBoard.cs | 106 ------ Assets/_Scripts/PuzzleGridBoard.cs.meta | 2 - 8 files changed, 412 insertions(+), 354 deletions(-) delete mode 100644 Assets/_Scripts/CodingModeManager.cs delete mode 100644 Assets/_Scripts/CodingModeManager.cs.meta delete mode 100644 Assets/_Scripts/PuzzleGridBoard.cs delete mode 100644 Assets/_Scripts/PuzzleGridBoard.cs.meta diff --git a/Assets/XR/Settings/OpenXRPackageSettings.asset b/Assets/XR/Settings/OpenXRPackageSettings.asset index b5cc52d..d787921 100644 --- a/Assets/XR/Settings/OpenXRPackageSettings.asset +++ b/Assets/XR/Settings/OpenXRPackageSettings.asset @@ -1295,8 +1295,8 @@ MonoBehaviour: features: - {fileID: 7011443450567333355} - {fileID: -671281728444007487} - - {fileID: 6956056911768161135} - - {fileID: -1734471456787174204} + - {fileID: -901939997048047619} + - {fileID: 5091991234558418143} - {fileID: 8980318060753866109} - {fileID: -6559185765804338520} - {fileID: -4756202077021157709} @@ -1307,7 +1307,7 @@ MonoBehaviour: - {fileID: 348827886137839178} - {fileID: -7499073031166464939} - {fileID: 7666556398442971420} - - {fileID: 431653824124869831} + - {fileID: -7343570946846779558} - {fileID: 3985858319333531581} - {fileID: -6511185071715886993} - {fileID: -4363231183632145407} diff --git a/Assets/_Scenes/GameScene.unity b/Assets/_Scenes/GameScene.unity index 4ea8666..722a10a 100644 --- a/Assets/_Scenes/GameScene.unity +++ b/Assets/_Scenes/GameScene.unity @@ -202,6 +202,11 @@ Transform: m_CorrespondingSourceObject: {fileID: 6604251906483681177, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} m_PrefabInstance: {fileID: 104982398014678653} m_PrefabAsset: {fileID: 0} +--- !u!1 &37527803 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4778205561262749876, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} + m_PrefabInstance: {fileID: 4186822344475922601} + m_PrefabAsset: {fileID: 0} --- !u!1 &47849130 GameObject: m_ObjectHideFlags: 0 @@ -1212,6 +1217,11 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &210905933 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7823627092045440829, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} + m_PrefabInstance: {fileID: 3640276467859821741} + m_PrefabAsset: {fileID: 0} --- !u!1001 &215025540 PrefabInstance: m_ObjectHideFlags: 0 @@ -3266,13 +3276,17 @@ PrefabInstance: propertyPath: m_Name value: Canvas objectReference: {fileID: 0} + - target: {fileID: 2377890544361114799, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_SizeDelta.x + value: 300 + objectReference: {fileID: 0} - target: {fileID: 2377890544361114799, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 2377890544361114799, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_AnchoredPosition.y - value: 100 + value: 50 objectReference: {fileID: 0} - target: {fileID: 2735167350974518192, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_IsActive @@ -3282,6 +3296,10 @@ PrefabInstance: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 5607317499926819730, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_SizeDelta.x + value: 300 + objectReference: {fileID: 0} - target: {fileID: 5607317499926819730, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -3344,35 +3362,35 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_LocalPosition.z - value: -0.1 + value: -0.2 objectReference: {fileID: 0} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - propertyPath: m_AnchoredPosition.y value: 0.5 objectReference: {fileID: 0} + - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_LocalRotation.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_LocalRotation.y + value: -0.5 + objectReference: {fileID: 0} + - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_LocalRotation.z + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_AnchoredPosition.x + value: -0.25 + objectReference: {fileID: 0} + - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} + propertyPath: m_AnchoredPosition.y + value: -0.1 + objectReference: {fileID: 0} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_LocalEulerAnglesHint.x - value: 0 + value: 90 objectReference: {fileID: 0} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_LocalEulerAnglesHint.y @@ -3380,7 +3398,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_LocalEulerAnglesHint.z - value: 0 + value: 90 objectReference: {fileID: 0} - target: {fileID: 7101255417312058890, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} propertyPath: m_Camera @@ -13478,6 +13496,11 @@ Transform: m_CorrespondingSourceObject: {fileID: 1030996972, guid: abc00000000006984399163773085844, type: 3} m_PrefabInstance: {fileID: 486767487} m_PrefabAsset: {fileID: 0} +--- !u!1 &492625119 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 9216819149179022284, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} + m_PrefabInstance: {fileID: 2095262208529294143} + m_PrefabAsset: {fileID: 0} --- !u!1 &510806758 GameObject: m_ObjectHideFlags: 0 @@ -15178,6 +15201,27 @@ Transform: m_CorrespondingSourceObject: {fileID: 8226480903751366698, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} m_PrefabInstance: {fileID: 2095262208529294143} m_PrefabAsset: {fileID: 0} +--- !u!65 &708395473 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 492625119} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1001 &717394379 PrefabInstance: m_ObjectHideFlags: 0 @@ -642277,6 +642321,11 @@ MeshRenderer: m_SortingOrder: 0 m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1145731096 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2937587418227847789, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} + m_PrefabInstance: {fileID: 6633365218206243196} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1145924571 PrefabInstance: m_ObjectHideFlags: 0 @@ -642650,6 +642699,32 @@ MeshRenderer: m_SortingOrder: 0 m_MaskInteraction: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &1161388811 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5032480607239006193, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} + m_PrefabInstance: {fileID: 681754957034778666} + m_PrefabAsset: {fileID: 0} +--- !u!65 &1161388815 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161388811} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1001 &1162837651 PrefabInstance: m_ObjectHideFlags: 0 @@ -643623,6 +643698,27 @@ Transform: m_CorrespondingSourceObject: {fileID: 1768866887463920207, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} m_PrefabInstance: {fileID: 3640276467859821741} m_PrefabAsset: {fileID: 0} +--- !u!65 &1248085326 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 210905933} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1001 &1268772232 PrefabInstance: m_ObjectHideFlags: 0 @@ -643772,11 +643868,53 @@ Transform: m_CorrespondingSourceObject: {fileID: 5734629024927422593, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} m_PrefabInstance: {fileID: 6633365218206243196} m_PrefabAsset: {fileID: 0} +--- !u!65 &1273306987 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1145731096} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!4 &1275427781 stripped Transform: m_CorrespondingSourceObject: {fileID: 4039009434348113054, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} m_PrefabInstance: {fileID: 4186822344475922601} m_PrefabAsset: {fileID: 0} +--- !u!65 &1275427785 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 37527803} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1001 &1295338065 PrefabInstance: m_ObjectHideFlags: 0 @@ -645934,7 +646072,6 @@ MonoBehaviour: maxGauge: 10 currentGauge: 0 codingModeUI: {fileID: 797096988} - puzzleBoard: {fileID: 3150725272858075539, guid: 469b8fdf008b844589dcc60b237284c5, type: 3} buffDuration: 10 attackBuffMultiplier: 1.5 defenseBuffMultiplier: 0.5 @@ -654095,6 +654232,32 @@ Transform: m_CorrespondingSourceObject: {fileID: 1030976941, guid: abc00000000003363950952516940468, type: 3} m_PrefabInstance: {fileID: 2070959559} m_PrefabAsset: {fileID: 0} +--- !u!1 &2079989142 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3381136080864684247, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} + m_PrefabInstance: {fileID: 104982398014678653} + m_PrefabAsset: {fileID: 0} +--- !u!65 &2079989146 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2079989142} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1001 &2104846428 PrefabInstance: m_ObjectHideFlags: 0 @@ -654890,10 +655053,21 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 9066539585895103147, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9167363296052431069, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} + propertyPath: snapPoint + value: + objectReference: {fileID: 30598970} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 3381136080864684247, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} + insertIndex: -1 + addedObject: {fileID: 2079989146} m_SourcePrefab: {fileID: 100100000, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} --- !u!1001 &681754957034778666 PrefabInstance: @@ -654903,6 +655077,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 797096992} m_Modifications: + - target: {fileID: 4330209953379345427, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} + propertyPath: snapPoint + value: + objectReference: {fileID: 401547933} - target: {fileID: 5032480607239006193, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} propertyPath: m_Name value: Block_C_Green @@ -654959,10 +655137,17 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 8516469430988388566, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 5032480607239006193, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} + insertIndex: -1 + addedObject: {fileID: 1161388815} m_SourcePrefab: {fileID: 100100000, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} --- !u!1001 &1488148268639052816 PrefabInstance: @@ -655149,6 +655334,14 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 797096992} m_Modifications: + - target: {fileID: 1426665687613428121, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3938032902931478084, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} + propertyPath: snapPoint + value: + objectReference: {fileID: 708395469} - target: {fileID: 8226480903751366698, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} propertyPath: m_LocalScale.x value: 1000 @@ -655208,7 +655401,10 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 9216819149179022284, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} + insertIndex: -1 + addedObject: {fileID: 708395473} m_SourcePrefab: {fileID: 100100000, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} --- !u!1001 &3640276467859821741 PrefabInstance: @@ -655218,6 +655414,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 797096992} m_Modifications: + - target: {fileID: 821979376305434536, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} + propertyPath: snapPoint + value: + objectReference: {fileID: 1248085322} - target: {fileID: 1768866887463920207, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} propertyPath: m_LocalScale.x value: 1000 @@ -655270,6 +655470,18 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 2119852981063027830, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2119852981063027830, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 210905933} + - target: {fileID: 2119852981063027830, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: + objectReference: {fileID: 0} - target: {fileID: 7823627092045440829, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} propertyPath: m_Name value: Block_T_Red @@ -655277,7 +655489,10 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 7823627092045440829, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} + insertIndex: -1 + addedObject: {fileID: 1248085326} m_SourcePrefab: {fileID: 100100000, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} --- !u!1001 &3884695503744945293 PrefabInstance: @@ -655365,6 +655580,14 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 797096992} m_Modifications: + - target: {fileID: 867192160738471439, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1432571202223285719, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} + propertyPath: snapPoint + value: + objectReference: {fileID: 1275427781} - target: {fileID: 4039009434348113054, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} propertyPath: m_LocalScale.x value: 1000 @@ -655424,7 +655647,10 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4778205561262749876, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} + insertIndex: -1 + addedObject: {fileID: 1275427785} m_SourcePrefab: {fileID: 100100000, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} --- !u!1001 &5700050917774472237 PrefabInstance: @@ -655438,6 +655664,10 @@ PrefabInstance: propertyPath: m_Name value: PuzzleGridBoard objectReference: {fileID: 0} + - target: {fileID: 8814118127558288880, guid: 469b8fdf008b844589dcc60b237284c5, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8881403597935108509, guid: 469b8fdf008b844589dcc60b237284c5, type: 3} propertyPath: m_LocalScale.x value: 1000 @@ -655503,6 +655733,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 797096992} m_Modifications: + - target: {fileID: 1083247988141345180, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} + propertyPath: snapPoint + value: + objectReference: {fileID: 1273306983} - target: {fileID: 2937587418227847789, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} propertyPath: m_Name value: Block_T_Blue @@ -655559,10 +655793,17 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 8587565743706018431, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} + propertyPath: m_SelectEntered.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 2937587418227847789, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} + insertIndex: -1 + addedObject: {fileID: 1273306987} m_SourcePrefab: {fileID: 100100000, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: diff --git a/Assets/_Scripts/CodingModeManager.cs b/Assets/_Scripts/CodingModeManager.cs deleted file mode 100644 index 72e5429..0000000 --- a/Assets/_Scripts/CodingModeManager.cs +++ /dev/null @@ -1,108 +0,0 @@ -using UnityEngine; -using UnityEngine.XR.Interaction.Toolkit; -using UnityEngine.XR.Interaction.Toolkit.Interactors; - -public class CodingModeManager : MonoBehaviour -{ - [Header("ソケットスロットの設定")] - [Tooltip("台座に配置した Slot_A の XRSocketInteractor を指定してください")] - [SerializeField] private XRSocketInteractor socketA; - [Tooltip("台座に配置した Slot_B の XRSocketInteractor を指定してください")] - [SerializeField] private XRSocketInteractor socketB; - - [Header("XR Interaction Toolkit 移動系コンポーネント")] - [Tooltip("Continuous Move Provider などの移動スクリプトをアタッチ")] - [SerializeField] private Behaviour moveProvider; - - [Tooltip("Snap Turn Provider や Continuous Turn Provider などの旋回スクリプトをアタッチ")] - [SerializeField] private Behaviour turnProvider; - - public bool IsCodingModeActive { get; private set; } = false; - - private void OnEnable() - { - // ソケットにオブジェクトが「ハメ込まれた瞬間」のイベントを登録 - if (socketA != null) socketA.selectEntered.AddListener(OnSocketAEntered); - if (socketB != null) socketB.selectEntered.AddListener(OnSocketBEntered); - } - - private void OnDisable() - { - // イベントの登録解除 - if (socketA != null) socketA.selectEntered.RemoveListener(OnSocketAEntered); - if (socketB != null) socketB.selectEntered.RemoveListener(OnSocketBEntered); - } - - // Slot_A に何かがハメ込まれた時のコールバック - private void OnSocketAEntered(SelectEnterEventArgs args) - { - CheckPuzzleCompletion(); - } - - // Slot_B に何かがハメ込まれた時のコールバック - private void OnSocketBEntered(SelectEnterEventArgs args) - { - CheckPuzzleCompletion(); - } - - private void CheckPuzzleCompletion() - { - if (socketA == null || socketB == null) return; - - // 両方のソケットがオブジェクトを保持(hasSelection)しているか確認 - if (socketA.hasSelection && socketB.hasSelection) - { - // ハメ込まれているオブジェクト(Interactable)を取得 - var objA = socketA.firstInteractableSelected; - var objB = socketB.firstInteractableSelected; - - if (objA != null && objB != null) - { - // オブジェクトの名前から、どのバフ四角形かを判別する文字列を抽出 - string buff1 = GetBuffNameFromObjectName(objA.transform.gameObject.name); - string buff2 = GetBuffNameFromObjectName(objB.transform.gameObject.name); - - Debug.Log($"💻 パズル連結完了! 検出されたコンボ: [{buff1}] + [{buff2}]"); - - ClearSockets(); - - // PlayerStatusManagerにバフを適用させ、時間停止を解除してプレイ画面に戻る - if (PlayerStatusManager.Instance != null) - { - //PlayerStatusManager.Instance.ApplyBuffsAndResume(buff1, buff2); - } - } - } - } - private string GetBuffNameFromObjectName(string objName) - { - if (objName.Contains("AttackUp")) return "AttackUp"; - if (objName.Contains("DefenseUp")) return "DefenseUp"; - if (objName.Contains("Heal")) return "Heal"; - return "Unknown"; - } - - private void ClearSockets() - { - - if (socketA.firstInteractableSelected != null) - { - socketA.firstInteractableSelected.transform.position = transform.position + (transform.forward * -0.2f); - } - if (socketB.firstInteractableSelected != null) - { - socketB.firstInteractableSelected.transform.position = transform.position + (transform.forward * -0.2f) + (transform.right * 0.1f); - } - } - - public void ToggleCodingMode() - { - IsCodingModeActive = !IsCodingModeActive; - - // CodingModeが有効(true)なら、enabled を false にして足止めする - if (moveProvider != null) moveProvider.enabled = !IsCodingModeActive; - if (turnProvider != null) turnProvider.enabled = !IsCodingModeActive; - - Debug.Log($"💻 CodingMode: {(IsCodingModeActive ? "ON (移動・旋回を一時ロック)" : "OFF (移動解禁)")}"); - } -} \ No newline at end of file diff --git a/Assets/_Scripts/CodingModeManager.cs.meta b/Assets/_Scripts/CodingModeManager.cs.meta deleted file mode 100644 index 40eac62..0000000 --- a/Assets/_Scripts/CodingModeManager.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 945a90d6fc5ecb048849ec7b83634441 \ No newline at end of file diff --git a/Assets/_Scripts/PlayerStatusManager.cs b/Assets/_Scripts/PlayerStatusManager.cs index a90505e..f88a4ec 100644 --- a/Assets/_Scripts/PlayerStatusManager.cs +++ b/Assets/_Scripts/PlayerStatusManager.cs @@ -3,15 +3,11 @@ using UnityEngine.InputSystem; using UnityEngine.AI; using System.Collections.Generic; -/// -/// プレイヤーの共通ゲージ、時間停止(Codingモード)、UI、および各種バフの制限時間を管理するクラス -/// public class PlayerStatusManager : MonoBehaviour { public static PlayerStatusManager Instance { get; private set; } [Header("デバッグ設定")] - [Tooltip("チェックを入れると、ゲージが溜まっていなくてもZLZRでCodingModeを開けます(テスト用)")] [SerializeField] private bool ignoreGaugeForDebug = true; [Header("Codingモード用 入力設定")] @@ -19,13 +15,10 @@ public class PlayerStatusManager : MonoBehaviour [SerializeField] private InputActionProperty zrButtonAction; [Header("プレイヤー移動・操作制御用 入力設定")] - [Tooltip("プレイヤーの移動入力(例: LeftHand Move)のアクションを指定してください")] [SerializeField] private InputActionProperty moveAction; - [Tooltip("プレイヤーの視点回転入力(例: RightHand Turn)があれば指定してください(任意)")] [SerializeField] private InputActionProperty turnAction; [Header("パズル制限時間設定")] - [Tooltip("CodingModeパズルの制限時間(秒)")] [SerializeField] private float codingLimitDuration = 15f; private float codingTimer = 0f; @@ -35,12 +28,15 @@ public class PlayerStatusManager : MonoBehaviour [Header("表示UI設定")] [SerializeField] private GameObject codingModeUI; - [SerializeField] private PuzzleGridBoard puzzleBoard; // 盤面参照 [Header("バフパラメータ設定")] + [Tooltip("攻撃力UP・防御力UPの持続時間 (秒)")] [SerializeField] private float buffDuration = 10f; + [Tooltip("攻撃力UP時のダメージ倍率")] [SerializeField] private float attackBuffMultiplier = 1.5f; + [Tooltip("防御力UP時の被ダメージ軽減率")] [SerializeField] private float defenseBuffMultiplier = 0.5f; + [Tooltip("HP回復バフ発動時の回復量")] [SerializeField] private float hpHealAmount = 30f; private float attackBuffTimer = 0f; @@ -124,14 +120,9 @@ public class PlayerStatusManager : MonoBehaviour { if (zlButtonAction.action == null || zrButtonAction.action == null) return; - // 入力値の読み取り float zlVal = zlButtonAction.action.ReadValue(); float zrVal = zrButtonAction.action.ReadValue(); - bool zlPressed = zlButtonAction.action.triggered || zlVal > 0.5f; - bool zrPressed = zrButtonAction.action.triggered || zrVal > 0.5f; - - // 両方のトリガーが引かれているか bool isBothHeld = zlVal > 0.5f && zrVal > 0.5f; bool isAnyTriggered = zlButtonAction.action.triggered || zrButtonAction.action.triggered; @@ -139,19 +130,17 @@ public class PlayerStatusManager : MonoBehaviour { if (!isCodingMode) { - // ゲージチェック(デバッグフラグがONならゲージ無視で起動) if (ignoreGaugeForDebug || currentGauge >= maxGauge) { StartCodingMode(); } else { - Debug.LogWarning($"⚠️ ゲージが足りないためCodingModeを開けません。現在: {currentGauge} / 必要: {maxGauge}"); + Debug.LogWarning($"⚠️ ゲージ不足のためCodingModeを開始できません。現在: {currentGauge} / 必要: {maxGauge}"); } } else { - // CodingMode中に再度同時押し ➔ キャンセルして無消費で復帰 CancelCodingMode(); } } @@ -162,11 +151,14 @@ public class PlayerStatusManager : MonoBehaviour isCodingMode = true; codingTimer = codingLimitDuration; - if (puzzleBoard != null) puzzleBoard.ClearBoard(); + // 1. プレイヤーの移動制御をロック DisableAction(moveAction); DisableAction(turnAction); - // 敵のアニメーション・NavMesh停止 + // 2. パズルブロックの状態・位置を全リセット + PuzzleBlock.ResetAllBlocksInScene(); + + // 3. 敵のアニメーション・NavMeshを停止 foreach (var anim in FindObjectsByType(FindObjectsSortMode.None)) { if (anim == null || anim.gameObject == this.gameObject || anim.CompareTag("Player")) continue; @@ -181,7 +173,7 @@ public class PlayerStatusManager : MonoBehaviour } if (codingModeUI != null) codingModeUI.SetActive(true); - Debug.Log($"⏳ Codingモード開始(パズル制限時間: {codingLimitDuration}秒)"); + Debug.Log($"⏳ Codingモード開始(制限時間: {codingLimitDuration}秒)"); } public void ApplyBuffsAndResume(string buff1, string buff2) @@ -189,19 +181,19 @@ public class PlayerStatusManager : MonoBehaviour ActivateBuffByName(buff1); ActivateBuffByName(buff2); ResumeWorldState(consumeGauge: true); - Debug.Log("🎉 パズル成功!バフを適用して再開。"); + Debug.Log("🎉 パズル成功!バフを適用してゲームを再開しました。"); } private void FailCodingModeByTimeout() { ResumeWorldState(consumeGauge: true); - Debug.Log("💀 時間切れ! Codingモード失敗(バフなし・ゲージ消費)。"); + Debug.Log("💀 制限時間切れ! Codingモード失敗(バフなし・ゲージ消費)。"); } public void CancelCodingMode() { ResumeWorldState(consumeGauge: false); - Debug.Log("↩️ Codingモード手動キャンセル。"); + Debug.Log("↩️ Codingモードを手動キャンセルしました。"); } private void ResumeWorldState(bool consumeGauge) diff --git a/Assets/_Scripts/PuzzleBlock.cs b/Assets/_Scripts/PuzzleBlock.cs index cf14f0b..1a0bf6a 100644 --- a/Assets/_Scripts/PuzzleBlock.cs +++ b/Assets/_Scripts/PuzzleBlock.cs @@ -1,105 +1,148 @@ using UnityEngine; -using System.Collections.Generic; +using UnityEngine.XR.Interaction.Toolkit.Interactables; // XR Toolkit用 public enum BlockColor { Red, Blue, Green } -public enum BlockShapeType { TShape, CShape } +public enum BlockShapeType { TShape, CShape } // ト字, コ字 public class PuzzleBlock : MonoBehaviour { [field: SerializeField] public BlockColor Color { get; private set; } [field: SerializeField] public BlockShapeType ShapeType { get; private set; } - // 原点(0,0)を基準としたブロックのマス配置データ - public List LocalCells { get; private set; } = new List(); + [Header("スナップ(合体)位置の設定")] + [Tooltip("相手と合体する基準位置(空のGameObject)を指定。未設定でも中心位置でスナップします")] + [SerializeField] private Transform snapPoint; - private PuzzleGridBoard currentBoard; - private bool isGrabbed = false; + private PuzzleBlock nearbyPartner; // 近くにある結合対象のブロック + private bool isConnected = false; // 結合済みフラグ + + // リセット用の初期座標・回転保持用 + private Vector3 initialPosition; + private Quaternion initialRotation; + private Rigidbody rb; + private XRGrabInteractable grabInteractable; private void Awake() { - InitializeShapeCells(); + rb = GetComponent(); + grabInteractable = GetComponent(); + + // 初期スポーン位置・回転を記憶しておく + initialPosition = transform.position; + initialRotation = transform.rotation; } - private void InitializeShapeCells() - { - LocalCells.Clear(); - - if (ShapeType == BlockShapeType.TShape) - { - LocalCells.Add(new Vector2Int(0, 0)); - LocalCells.Add(new Vector2Int(0, 1)); - LocalCells.Add(new Vector2Int(0, 2)); - LocalCells.Add(new Vector2Int(1, 1)); - } - else if (ShapeType == BlockShapeType.CShape) - { - LocalCells.Add(new Vector2Int(0, 0)); - LocalCells.Add(new Vector2Int(1, 0)); - LocalCells.Add(new Vector2Int(0, 1)); - LocalCells.Add(new Vector2Int(0, 2)); - LocalCells.Add(new Vector2Int(1, 2)); - } - } - - public List GetRotatedCells() - { - List rotated = new List(); - // 現在のY回転を90度単位に丸める (0, 1, 2, 3) - int steps = Mathf.RoundToInt(transform.eulerAngles.y / 180f) % 4; - if (steps < 0) steps += 4; - - foreach (var cell in LocalCells) - { - Vector2Int c = cell; - for (int i = 0; i < steps; i++) - { - // 時計回りに90度回転: (x, y) -> (y, -x) - c = new Vector2Int(c.y, -c.x); - } - rotated.Add(c); - } - return rotated; - } - - public void OnGrabbed() - { - isGrabbed = true; - if (currentBoard != null) - { - currentBoard.RemoveBlock(this); - currentBoard = null; - } - } - - // PuzzleBlock.cs 内に以下を追加・修正 - private PuzzleGridBoard overlappingBoard; - private void OnTriggerEnter(Collider other) { - var board = other.GetComponentInParent(); - if (board != null) overlappingBoard = board; + if (isConnected) return; + + PuzzleBlock partner = other.GetComponentInParent(); + if (partner != null && IsValidPartner(partner)) + { + nearbyPartner = partner; + Debug.Log($"🧩 パートナー検知: {partner.Color} の {partner.ShapeType}"); + } } private void OnTriggerExit(Collider other) { - var board = other.GetComponentInParent(); - if (board == overlappingBoard) overlappingBoard = null; - } - - // 引数なしで呼べるように変更 - public void OnReleased() - { - isGrabbed = false; - - // 1. 手の傾きを最も近い90度単位にスナップ補正 - Vector3 currentEuler = transform.eulerAngles; - float snappedY = Mathf.Round(currentEuler.y / 90f) * 90f; - transform.rotation = Quaternion.Euler(0f, snappedY, 0f); - - // 2. 近くにある盤面へのセットを試みる - if (overlappingBoard != null && overlappingBoard.TryPlaceBlock(this)) + PuzzleBlock partner = other.GetComponentInParent(); + if (partner == nearbyPartner) { - currentBoard = overlappingBoard; + nearbyPartner = null; } } + + private bool IsValidPartner(PuzzleBlock partner) + { + if (partner == null || partner.isConnected) return false; + // 同一色 & 異なる形状(ト字 + コ字)のみ許可 + return partner.Color == this.Color && partner.ShapeType != this.ShapeType; + } + + public void OnReleased() + { + if (isConnected) return; + + if (nearbyPartner != null) + { + ConnectToPartner(nearbyPartner); + } + } + + private void ConnectToPartner(PuzzleBlock partner) + { + isConnected = true; + partner.isConnected = true; + + // 1. 位置・回転のスナップ補正 + if (snapPoint != null && partner.snapPoint != null) + { + transform.position = partner.snapPoint.position; + transform.rotation = partner.snapPoint.rotation; + } + else + { + transform.position = partner.transform.position; + transform.rotation = partner.transform.rotation; + } + + // 2. 物理&VR掴み動作の完全ロック(完成後に崩れないようにする) + LockBlockState(); + partner.LockBlockState(); + + Debug.Log($"🎉 マグネット合体成功! 色: {Color}"); + + // 3. バフ適用してCodingMode完了へ + string buffName = ConvertColorToBuffName(Color); + PlayerStatusManager.Instance.ApplyBuffsAndResume(buffName, buffName); + } + + private void LockBlockState() + { + if (rb != null) + { + rb.linearVelocity = Vector3.zero; + rb.angularVelocity = Vector3.zero; + rb.isKinematic = true; + } + // 掴みコンポーネントをオフにして手から切り離す + if (grabInteractable != null) grabInteractable.enabled = false; + } + + public void ResetBlock() + { + isConnected = false; + nearbyPartner = null; + + transform.position = initialPosition; + transform.rotation = initialRotation; + + if (rb != null) + { + rb.isKinematic = false; + rb.linearVelocity = Vector3.zero; + rb.angularVelocity = Vector3.zero; + } + if (grabInteractable != null) grabInteractable.enabled = true; + } + + public static void ResetAllBlocksInScene() + { + foreach (var block in FindObjectsByType(FindObjectsSortMode.None)) + { + if (block != null) block.ResetBlock(); + } + } + + private string ConvertColorToBuffName(BlockColor color) + { + return color switch + { + BlockColor.Red => "AttackUp", + BlockColor.Blue => "DefenseUp", + BlockColor.Green => "Heal", + _ => "AttackUp" + }; + } } \ No newline at end of file diff --git a/Assets/_Scripts/PuzzleGridBoard.cs b/Assets/_Scripts/PuzzleGridBoard.cs deleted file mode 100644 index 53c4ab1..0000000 --- a/Assets/_Scripts/PuzzleGridBoard.cs +++ /dev/null @@ -1,106 +0,0 @@ -using UnityEngine; -using System.Collections.Generic; - -public class PuzzleGridBoard : MonoBehaviour -{ - [Header("盤面設定")] - [SerializeField] private float cellSize = 0.1f; // 1マスのサイズ(メートル) - [SerializeField] private Transform originAnchor; // 3x3の左下(0,0)の基準Transform - - // 3x3 のマス目データ(設置されているブロックを管理) - private PuzzleBlock[,] grid = new PuzzleBlock[3, 3]; - private List placedBlocks = new List(); - - public bool TryPlaceBlock(PuzzleBlock block) - { - // ブロックの原点位置から盤面のグリッド座標(0~2, 0~2)を算出 - Vector3 localPos = originAnchor.InverseTransformPoint(block.transform.position); - int originX = Mathf.RoundToInt(localPos.x / cellSize); - int originY = Mathf.RoundToInt(localPos.z / cellSize); - - List shapeCells = block.GetRotatedCells(); - - // 設置可能かチェック(はみ出し・重ね被りがないか) - foreach (var cell in shapeCells) - { - int targetX = originX + cell.x; - int targetY = originY + cell.y; - - if (targetX < 0 || targetX >= 3 || targetY < 0 || targetY >= 3) return false; // 盤面外 - if (grid[targetX, targetY] != null) return false; // すでに埋まっている - } - - // 設置確定処理 - foreach (var cell in shapeCells) - { - grid[originX + cell.x, originY + cell.y] = block; - } - placedBlocks.Add(block); - - // 吸い付き(スナップ)位置の固定 - Vector3 snapLocalPos = new Vector3(originX * cellSize, 0f, originY * cellSize); - block.transform.position = originAnchor.TransformPoint(snapLocalPos); - - // 成功チェック(全9マスが単一色で埋まったか) - EvaluateBoardComplete(); - return true; - } - - public void RemoveBlock(PuzzleBlock block) - { - for (int x = 0; x < 3; x++) - { - for (int y = 0; y < 3; y++) - { - if (grid[x, y] == block) grid[x, y] = null; - } - } - placedBlocks.Remove(block); - } - - private void EvaluateBoardComplete() - { - // 全9マスが埋まっているかチェック - for (int x = 0; x < 3; x++) - { - for (int y = 0; y < 3; y++) - { - if (grid[x, y] == null) return; // 空きマスがあるので未完成 - } - } - - // 全ブロックの色が統一されているかチェック - BlockColor firstColor = placedBlocks[0].Color; - foreach (var b in placedBlocks) - { - if (b.Color != firstColor) - { - Debug.Log("❌ 3x3は埋まりましたが、色が混ざっているため失敗です。"); - return; - } - } - - // ★パズル成功! 色に対応したバフを発動してCodingModeを終了する - Debug.Log($"🎉 パズル成功! 単一色 ({firstColor}) で完成しました!"); - string buffName = ConvertColorToBuffName(firstColor); - - PlayerStatusManager.Instance.ApplyBuffsAndResume(buffName, buffName); - } - - private string ConvertColorToBuffName(BlockColor color) - { - return color switch - { - BlockColor.Red => "AttackUp", - BlockColor.Blue => "DefenseUp", - BlockColor.Green => "Heal", - _ => "AttackUp" - }; - } - - public void ClearBoard() - { - grid = new PuzzleBlock[3, 3]; - placedBlocks.Clear(); - } -} \ No newline at end of file diff --git a/Assets/_Scripts/PuzzleGridBoard.cs.meta b/Assets/_Scripts/PuzzleGridBoard.cs.meta deleted file mode 100644 index 7095244..0000000 --- a/Assets/_Scripts/PuzzleGridBoard.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 3c49da017d0074aa4b9f4c23133fbb5d \ No newline at end of file