codingmosaku

This commit is contained in:
ohgushiyuga
2026-07-23 16:30:29 +09:00
parent 2f47302b9e
commit f0df7736f4
8 changed files with 412 additions and 354 deletions

View File

@@ -1295,8 +1295,8 @@ MonoBehaviour:
features: features:
- {fileID: 7011443450567333355} - {fileID: 7011443450567333355}
- {fileID: -671281728444007487} - {fileID: -671281728444007487}
- {fileID: 6956056911768161135} - {fileID: -901939997048047619}
- {fileID: -1734471456787174204} - {fileID: 5091991234558418143}
- {fileID: 8980318060753866109} - {fileID: 8980318060753866109}
- {fileID: -6559185765804338520} - {fileID: -6559185765804338520}
- {fileID: -4756202077021157709} - {fileID: -4756202077021157709}
@@ -1307,7 +1307,7 @@ MonoBehaviour:
- {fileID: 348827886137839178} - {fileID: 348827886137839178}
- {fileID: -7499073031166464939} - {fileID: -7499073031166464939}
- {fileID: 7666556398442971420} - {fileID: 7666556398442971420}
- {fileID: 431653824124869831} - {fileID: -7343570946846779558}
- {fileID: 3985858319333531581} - {fileID: 3985858319333531581}
- {fileID: -6511185071715886993} - {fileID: -6511185071715886993}
- {fileID: -4363231183632145407} - {fileID: -4363231183632145407}

View File

@@ -202,6 +202,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 6604251906483681177, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3} m_CorrespondingSourceObject: {fileID: 6604251906483681177, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3}
m_PrefabInstance: {fileID: 104982398014678653} m_PrefabInstance: {fileID: 104982398014678653}
m_PrefabAsset: {fileID: 0} 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 --- !u!1 &47849130
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -1212,6 +1217,11 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 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 --- !u!1001 &215025540
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -3266,13 +3276,17 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Canvas value: Canvas
objectReference: {fileID: 0} 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} - target: {fileID: 2377890544361114799, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2377890544361114799, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 2377890544361114799, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 100 value: 50
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2735167350974518192, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 2735167350974518192, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
@@ -3282,6 +3296,10 @@ PrefabInstance:
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 1
objectReference: {fileID: 0} 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} - target: {fileID: 5607317499926819730, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 0
@@ -3344,35 +3362,35 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.1 value: -0.2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_LocalRotation.w 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 value: 0.5
objectReference: {fileID: 0} 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} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
value: 0 value: 90
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
@@ -3380,7 +3398,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 5730287519658216829, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 90
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7101255417312058890, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3} - target: {fileID: 7101255417312058890, guid: 9305e37606b654a56b3c00dcc3ebd599, type: 3}
propertyPath: m_Camera propertyPath: m_Camera
@@ -13478,6 +13496,11 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1030996972, guid: abc00000000006984399163773085844, type: 3} m_CorrespondingSourceObject: {fileID: 1030996972, guid: abc00000000006984399163773085844, type: 3}
m_PrefabInstance: {fileID: 486767487} m_PrefabInstance: {fileID: 486767487}
m_PrefabAsset: {fileID: 0} 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 --- !u!1 &510806758
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -15178,6 +15201,27 @@ Transform:
m_CorrespondingSourceObject: {fileID: 8226480903751366698, guid: 90a15f797f7ea4462b3a28425697a622, type: 3} m_CorrespondingSourceObject: {fileID: 8226480903751366698, guid: 90a15f797f7ea4462b3a28425697a622, type: 3}
m_PrefabInstance: {fileID: 2095262208529294143} m_PrefabInstance: {fileID: 2095262208529294143}
m_PrefabAsset: {fileID: 0} 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 --- !u!1001 &717394379
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -642277,6 +642321,11 @@ MeshRenderer:
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0 m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 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 --- !u!1001 &1145924571
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -642650,6 +642699,32 @@ MeshRenderer:
m_SortingOrder: 0 m_SortingOrder: 0
m_MaskInteraction: 0 m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 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 --- !u!1001 &1162837651
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -643623,6 +643698,27 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1768866887463920207, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} m_CorrespondingSourceObject: {fileID: 1768866887463920207, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3}
m_PrefabInstance: {fileID: 3640276467859821741} m_PrefabInstance: {fileID: 3640276467859821741}
m_PrefabAsset: {fileID: 0} 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 --- !u!1001 &1268772232
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -643772,11 +643868,53 @@ Transform:
m_CorrespondingSourceObject: {fileID: 5734629024927422593, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} m_CorrespondingSourceObject: {fileID: 5734629024927422593, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3}
m_PrefabInstance: {fileID: 6633365218206243196} m_PrefabInstance: {fileID: 6633365218206243196}
m_PrefabAsset: {fileID: 0} 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 --- !u!4 &1275427781 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 4039009434348113054, guid: f17b1b6d08af54483bd0665b3079c767, type: 3} m_CorrespondingSourceObject: {fileID: 4039009434348113054, guid: f17b1b6d08af54483bd0665b3079c767, type: 3}
m_PrefabInstance: {fileID: 4186822344475922601} m_PrefabInstance: {fileID: 4186822344475922601}
m_PrefabAsset: {fileID: 0} 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 --- !u!1001 &1295338065
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -645934,7 +646072,6 @@ MonoBehaviour:
maxGauge: 10 maxGauge: 10
currentGauge: 0 currentGauge: 0
codingModeUI: {fileID: 797096988} codingModeUI: {fileID: 797096988}
puzzleBoard: {fileID: 3150725272858075539, guid: 469b8fdf008b844589dcc60b237284c5, type: 3}
buffDuration: 10 buffDuration: 10
attackBuffMultiplier: 1.5 attackBuffMultiplier: 1.5
defenseBuffMultiplier: 0.5 defenseBuffMultiplier: 0.5
@@ -654095,6 +654232,32 @@ Transform:
m_CorrespondingSourceObject: {fileID: 1030976941, guid: abc00000000003363950952516940468, type: 3} m_CorrespondingSourceObject: {fileID: 1030976941, guid: abc00000000003363950952516940468, type: 3}
m_PrefabInstance: {fileID: 2070959559} m_PrefabInstance: {fileID: 2070959559}
m_PrefabAsset: {fileID: 0} 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 --- !u!1001 &2104846428
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -654890,10 +655053,21 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 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_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] 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} m_SourcePrefab: {fileID: 100100000, guid: 7519d43bc4d9145b496310c767ba2c29, type: 3}
--- !u!1001 &681754957034778666 --- !u!1001 &681754957034778666
PrefabInstance: PrefabInstance:
@@ -654903,6 +655077,10 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 797096992} m_TransformParent: {fileID: 797096992}
m_Modifications: m_Modifications:
- target: {fileID: 4330209953379345427, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3}
propertyPath: snapPoint
value:
objectReference: {fileID: 401547933}
- target: {fileID: 5032480607239006193, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3} - target: {fileID: 5032480607239006193, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Block_C_Green value: Block_C_Green
@@ -654959,10 +655137,17 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 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_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] 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} m_SourcePrefab: {fileID: 100100000, guid: 5ed6e594a34ea4d56a4ae0b7d3cea896, type: 3}
--- !u!1001 &1488148268639052816 --- !u!1001 &1488148268639052816
PrefabInstance: PrefabInstance:
@@ -655149,6 +655334,14 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 797096992} m_TransformParent: {fileID: 797096992}
m_Modifications: 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} - target: {fileID: 8226480903751366698, guid: 90a15f797f7ea4462b3a28425697a622, type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 1000 value: 1000
@@ -655208,7 +655401,10 @@ PrefabInstance:
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] 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} m_SourcePrefab: {fileID: 100100000, guid: 90a15f797f7ea4462b3a28425697a622, type: 3}
--- !u!1001 &3640276467859821741 --- !u!1001 &3640276467859821741
PrefabInstance: PrefabInstance:
@@ -655218,6 +655414,10 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 797096992} m_TransformParent: {fileID: 797096992}
m_Modifications: m_Modifications:
- target: {fileID: 821979376305434536, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3}
propertyPath: snapPoint
value:
objectReference: {fileID: 1248085322}
- target: {fileID: 1768866887463920207, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3} - target: {fileID: 1768866887463920207, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 1000 value: 1000
@@ -655270,6 +655470,18 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 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} - target: {fileID: 7823627092045440829, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Block_T_Red value: Block_T_Red
@@ -655277,7 +655489,10 @@ PrefabInstance:
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] 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} m_SourcePrefab: {fileID: 100100000, guid: bbfff93834292479f8c9ed60140ee0c7, type: 3}
--- !u!1001 &3884695503744945293 --- !u!1001 &3884695503744945293
PrefabInstance: PrefabInstance:
@@ -655365,6 +655580,14 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 797096992} m_TransformParent: {fileID: 797096992}
m_Modifications: 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} - target: {fileID: 4039009434348113054, guid: f17b1b6d08af54483bd0665b3079c767, type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 1000 value: 1000
@@ -655424,7 +655647,10 @@ PrefabInstance:
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] 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} m_SourcePrefab: {fileID: 100100000, guid: f17b1b6d08af54483bd0665b3079c767, type: 3}
--- !u!1001 &5700050917774472237 --- !u!1001 &5700050917774472237
PrefabInstance: PrefabInstance:
@@ -655438,6 +655664,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: PuzzleGridBoard value: PuzzleGridBoard
objectReference: {fileID: 0} 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} - target: {fileID: 8881403597935108509, guid: 469b8fdf008b844589dcc60b237284c5, type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 1000 value: 1000
@@ -655503,6 +655733,10 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 797096992} m_TransformParent: {fileID: 797096992}
m_Modifications: m_Modifications:
- target: {fileID: 1083247988141345180, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3}
propertyPath: snapPoint
value:
objectReference: {fileID: 1273306983}
- target: {fileID: 2937587418227847789, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3} - target: {fileID: 2937587418227847789, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Block_T_Blue value: Block_T_Blue
@@ -655559,10 +655793,17 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 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_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] 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} m_SourcePrefab: {fileID: 100100000, guid: 101d8fa7abab84ac7ac221ee7f1dba1a, type: 3}
--- !u!1660057539 &9223372036854775807 --- !u!1660057539 &9223372036854775807
SceneRoots: SceneRoots:

View File

@@ -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 ()")}");
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 945a90d6fc5ecb048849ec7b83634441

View File

@@ -3,15 +3,11 @@ using UnityEngine.InputSystem;
using UnityEngine.AI; using UnityEngine.AI;
using System.Collections.Generic; using System.Collections.Generic;
/// <summary>
/// プレイヤーの共通ゲージ、時間停止Codingモード、UI、および各種バフの制限時間を管理するクラス
/// </summary>
public class PlayerStatusManager : MonoBehaviour public class PlayerStatusManager : MonoBehaviour
{ {
public static PlayerStatusManager Instance { get; private set; } public static PlayerStatusManager Instance { get; private set; }
[Header("デバッグ設定")] [Header("デバッグ設定")]
[Tooltip("チェックを入れると、ゲージが溜まっていなくてもZLZRでCodingModeを開けますテスト用")]
[SerializeField] private bool ignoreGaugeForDebug = true; [SerializeField] private bool ignoreGaugeForDebug = true;
[Header("Codingモード用 入力設定")] [Header("Codingモード用 入力設定")]
@@ -19,13 +15,10 @@ public class PlayerStatusManager : MonoBehaviour
[SerializeField] private InputActionProperty zrButtonAction; [SerializeField] private InputActionProperty zrButtonAction;
[Header("プレイヤー移動・操作制御用 入力設定")] [Header("プレイヤー移動・操作制御用 入力設定")]
[Tooltip("プレイヤーの移動入力(例: LeftHand Moveのアクションを指定してください")]
[SerializeField] private InputActionProperty moveAction; [SerializeField] private InputActionProperty moveAction;
[Tooltip("プレイヤーの視点回転入力(例: RightHand Turnがあれば指定してください任意")]
[SerializeField] private InputActionProperty turnAction; [SerializeField] private InputActionProperty turnAction;
[Header("パズル制限時間設定")] [Header("パズル制限時間設定")]
[Tooltip("CodingModeパズルの制限時間")]
[SerializeField] private float codingLimitDuration = 15f; [SerializeField] private float codingLimitDuration = 15f;
private float codingTimer = 0f; private float codingTimer = 0f;
@@ -35,12 +28,15 @@ public class PlayerStatusManager : MonoBehaviour
[Header("表示UI設定")] [Header("表示UI設定")]
[SerializeField] private GameObject codingModeUI; [SerializeField] private GameObject codingModeUI;
[SerializeField] private PuzzleGridBoard puzzleBoard; // 盤面参照
[Header("バフパラメータ設定")] [Header("バフパラメータ設定")]
[Tooltip("攻撃力UP・防御力UPの持続時間 (秒)")]
[SerializeField] private float buffDuration = 10f; [SerializeField] private float buffDuration = 10f;
[Tooltip("攻撃力UP時のダメージ倍率")]
[SerializeField] private float attackBuffMultiplier = 1.5f; [SerializeField] private float attackBuffMultiplier = 1.5f;
[Tooltip("防御力UP時の被ダメージ軽減率")]
[SerializeField] private float defenseBuffMultiplier = 0.5f; [SerializeField] private float defenseBuffMultiplier = 0.5f;
[Tooltip("HP回復バフ発動時の回復量")]
[SerializeField] private float hpHealAmount = 30f; [SerializeField] private float hpHealAmount = 30f;
private float attackBuffTimer = 0f; private float attackBuffTimer = 0f;
@@ -124,14 +120,9 @@ public class PlayerStatusManager : MonoBehaviour
{ {
if (zlButtonAction.action == null || zrButtonAction.action == null) return; if (zlButtonAction.action == null || zrButtonAction.action == null) return;
// 入力値の読み取り
float zlVal = zlButtonAction.action.ReadValue<float>(); float zlVal = zlButtonAction.action.ReadValue<float>();
float zrVal = zrButtonAction.action.ReadValue<float>(); float zrVal = zrButtonAction.action.ReadValue<float>();
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 isBothHeld = zlVal > 0.5f && zrVal > 0.5f;
bool isAnyTriggered = zlButtonAction.action.triggered || zrButtonAction.action.triggered; bool isAnyTriggered = zlButtonAction.action.triggered || zrButtonAction.action.triggered;
@@ -139,19 +130,17 @@ public class PlayerStatusManager : MonoBehaviour
{ {
if (!isCodingMode) if (!isCodingMode)
{ {
// ゲージチェックデバッグフラグがONならゲージ無視で起動
if (ignoreGaugeForDebug || currentGauge >= maxGauge) if (ignoreGaugeForDebug || currentGauge >= maxGauge)
{ {
StartCodingMode(); StartCodingMode();
} }
else else
{ {
Debug.LogWarning($"⚠️ ゲージが足りないためCodingModeを開ません。現在: {currentGauge} / 必要: {maxGauge}"); Debug.LogWarning($"⚠️ ゲージ不足のためCodingModeを開始できません。現在: {currentGauge} / 必要: {maxGauge}");
} }
} }
else else
{ {
// CodingMode中に再度同時押し ➔ キャンセルして無消費で復帰
CancelCodingMode(); CancelCodingMode();
} }
} }
@@ -162,11 +151,14 @@ public class PlayerStatusManager : MonoBehaviour
isCodingMode = true; isCodingMode = true;
codingTimer = codingLimitDuration; codingTimer = codingLimitDuration;
if (puzzleBoard != null) puzzleBoard.ClearBoard(); // 1. プレイヤーの移動制御をロック
DisableAction(moveAction); DisableAction(moveAction);
DisableAction(turnAction); DisableAction(turnAction);
// 敵のアニメーション・NavMesh停止 // 2. パズルブロックの状態・位置を全リセット
PuzzleBlock.ResetAllBlocksInScene();
// 3. 敵のアニメーション・NavMeshを停止
foreach (var anim in FindObjectsByType<Animator>(FindObjectsSortMode.None)) foreach (var anim in FindObjectsByType<Animator>(FindObjectsSortMode.None))
{ {
if (anim == null || anim.gameObject == this.gameObject || anim.CompareTag("Player")) continue; 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); if (codingModeUI != null) codingModeUI.SetActive(true);
Debug.Log($"⏳ Codingモード開始パズル制限時間: {codingLimitDuration}秒)"); Debug.Log($"⏳ Codingモード開始制限時間: {codingLimitDuration}秒)");
} }
public void ApplyBuffsAndResume(string buff1, string buff2) public void ApplyBuffsAndResume(string buff1, string buff2)
@@ -189,19 +181,19 @@ public class PlayerStatusManager : MonoBehaviour
ActivateBuffByName(buff1); ActivateBuffByName(buff1);
ActivateBuffByName(buff2); ActivateBuffByName(buff2);
ResumeWorldState(consumeGauge: true); ResumeWorldState(consumeGauge: true);
Debug.Log("🎉 パズル成功!バフを適用して再開。"); Debug.Log("🎉 パズル成功!バフを適用してゲームを再開しました。");
} }
private void FailCodingModeByTimeout() private void FailCodingModeByTimeout()
{ {
ResumeWorldState(consumeGauge: true); ResumeWorldState(consumeGauge: true);
Debug.Log("💀 時間切れ! Codingモード失敗バフなし・ゲージ消費。"); Debug.Log("💀 制限時間切れ! Codingモード失敗バフなし・ゲージ消費。");
} }
public void CancelCodingMode() public void CancelCodingMode()
{ {
ResumeWorldState(consumeGauge: false); ResumeWorldState(consumeGauge: false);
Debug.Log("↩️ Codingモード手動キャンセル。"); Debug.Log("↩️ Codingモード手動キャンセルしました。");
} }
private void ResumeWorldState(bool consumeGauge) private void ResumeWorldState(bool consumeGauge)

View File

@@ -1,105 +1,148 @@
using UnityEngine; using UnityEngine;
using System.Collections.Generic; using UnityEngine.XR.Interaction.Toolkit.Interactables; // XR Toolkit用
public enum BlockColor { Red, Blue, Green } public enum BlockColor { Red, Blue, Green }
public enum BlockShapeType { TShape, CShape } public enum BlockShapeType { TShape, CShape } // ト字, コ字
public class PuzzleBlock : MonoBehaviour public class PuzzleBlock : MonoBehaviour
{ {
[field: SerializeField] public BlockColor Color { get; private set; } [field: SerializeField] public BlockColor Color { get; private set; }
[field: SerializeField] public BlockShapeType ShapeType { get; private set; } [field: SerializeField] public BlockShapeType ShapeType { get; private set; }
// 原点(0,0)を基準としたブロックのマス配置データ [Header("スナップ(合体)位置の設定")]
public List<Vector2Int> LocalCells { get; private set; } = new List<Vector2Int>(); [Tooltip("相手と合体する基準位置空のGameObjectを指定。未設定でも中心位置でスナップします")]
[SerializeField] private Transform snapPoint;
private PuzzleGridBoard currentBoard; private PuzzleBlock nearbyPartner; // 近くにある結合対象のブロック
private bool isGrabbed = false; private bool isConnected = false; // 結合済みフラグ
// リセット用の初期座標・回転保持用
private Vector3 initialPosition;
private Quaternion initialRotation;
private Rigidbody rb;
private XRGrabInteractable grabInteractable;
private void Awake() private void Awake()
{ {
InitializeShapeCells(); rb = GetComponent<Rigidbody>();
grabInteractable = GetComponent<XRGrabInteractable>();
// 初期スポーン位置・回転を記憶しておく
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<Vector2Int> GetRotatedCells()
{
List<Vector2Int> rotated = new List<Vector2Int>();
// 現在の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) private void OnTriggerEnter(Collider other)
{ {
var board = other.GetComponentInParent<PuzzleGridBoard>(); if (isConnected) return;
if (board != null) overlappingBoard = board;
PuzzleBlock partner = other.GetComponentInParent<PuzzleBlock>();
if (partner != null && IsValidPartner(partner))
{
nearbyPartner = partner;
Debug.Log($"🧩 パートナー検知: {partner.Color} の {partner.ShapeType}");
}
} }
private void OnTriggerExit(Collider other) private void OnTriggerExit(Collider other)
{ {
var board = other.GetComponentInParent<PuzzleGridBoard>(); PuzzleBlock partner = other.GetComponentInParent<PuzzleBlock>();
if (board == overlappingBoard) overlappingBoard = null; if (partner == nearbyPartner)
}
// 引数なしで呼べるように変更
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))
{ {
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<PuzzleBlock>(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"
};
}
} }

View File

@@ -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<PuzzleBlock> placedBlocks = new List<PuzzleBlock>();
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<Vector2Int> 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();
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 3c49da017d0074aa4b9f4c23133fbb5d