puzzlestep_indicators #14
@@ -17,3 +17,4 @@ MonoBehaviour:
|
|||||||
description: Start up the lawnmower so the Gardener runs after it.
|
description: Start up the lawnmower so the Gardener runs after it.
|
||||||
icon: {fileID: 0}
|
icon: {fileID: 0}
|
||||||
unlocks: []
|
unlocks: []
|
||||||
|
showIndicator: 1
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ namespace AppleHills.Editor
|
|||||||
// Set up the delegates in SettingsAccess
|
// Set up the delegates in SettingsAccess
|
||||||
AppleHills.SettingsAccess.SetupEditorProviders(
|
AppleHills.SettingsAccess.SetupEditorProviders(
|
||||||
GetPlayerStopDistance,
|
GetPlayerStopDistance,
|
||||||
GetPlayerStopDistanceDirectInteraction
|
GetPlayerStopDistanceDirectInteraction,
|
||||||
|
GetPuzzlePromptRange
|
||||||
);
|
);
|
||||||
|
|
||||||
// Subscribe to asset changes to auto-refresh when settings are modified
|
// Subscribe to asset changes to auto-refresh when settings are modified
|
||||||
@@ -58,7 +59,8 @@ namespace AppleHills.Editor
|
|||||||
// Re-register the delegates in case they were lost
|
// Re-register the delegates in case they were lost
|
||||||
AppleHills.SettingsAccess.SetupEditorProviders(
|
AppleHills.SettingsAccess.SetupEditorProviders(
|
||||||
GetPlayerStopDistance,
|
GetPlayerStopDistance,
|
||||||
GetPlayerStopDistanceDirectInteraction
|
GetPlayerStopDistanceDirectInteraction,
|
||||||
|
GetPuzzlePromptRange
|
||||||
);
|
);
|
||||||
|
|
||||||
Debug.Log("Editor settings loaded for Scene View use");
|
Debug.Log("Editor settings loaded for Scene View use");
|
||||||
@@ -81,6 +83,11 @@ namespace AppleHills.Editor
|
|||||||
return _interactionSettings?.PlayerStopDistanceDirectInteraction ?? 2.0f;
|
return _interactionSettings?.PlayerStopDistanceDirectInteraction ?? 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static float GetPuzzlePromptRange()
|
||||||
|
{
|
||||||
|
return _interactionSettings?.DefaultPuzzlePromptRange ?? 3.0f;
|
||||||
|
}
|
||||||
|
|
||||||
// Other utility methods
|
// Other utility methods
|
||||||
public static T GetSettings<T>() where T : BaseSettings
|
public static T GetSettings<T>() where T : BaseSettings
|
||||||
{
|
{
|
||||||
|
|||||||
8
Assets/External/Placeholders/Materials.meta
vendored
Normal file
8
Assets/External/Placeholders/Materials.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 40c86a69ce6198849928969c19c95ca1
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
43
Assets/External/Placeholders/Materials/apple_red.mat
vendored
Normal file
43
Assets/External/Placeholders/Materials/apple_red.mat
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: apple_red
|
||||||
|
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_Parent: {fileID: 0}
|
||||||
|
m_ModifiedSerializedProperties: 0
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords: []
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_LockedProperties:
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _AlphaTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 2800000, guid: 00354ded9d8f8d643acc14837a229544, type: 3}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- PixelSnap: 0
|
||||||
|
- _EnableExternalAlpha: 0
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _Flip: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
|
m_AllowLocking: 1
|
||||||
8
Assets/External/Placeholders/Materials/apple_red.mat.meta
vendored
Normal file
8
Assets/External/Placeholders/Materials/apple_red.mat.meta
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 807266c5634eb434f9ada258a07c1c5c
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -354,6 +354,8 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: 0fb0ab2b55d93a24685e9f6651adcf30, type: 2}
|
stepData: {fileID: 11400000, guid: 0fb0ab2b55d93a24685e9f6651adcf30, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
--- !u!1 &7675352645851726746
|
--- !u!1 &7675352645851726746
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -430,6 +430,8 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: d0851a7610551104fa285c0748549d90, type: 2}
|
stepData: {fileID: 11400000, guid: d0851a7610551104fa285c0748549d90, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
--- !u!114 &488333850132012697
|
--- !u!114 &488333850132012697
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -439,6 +439,8 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: 28848561ff31fe24ea9f8590dee0bf8f, type: 2}
|
stepData: {fileID: 11400000, guid: 28848561ff31fe24ea9f8590dee0bf8f, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
--- !u!114 &8370367816617117734
|
--- !u!114 &8370367816617117734
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -150,3 +150,5 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: 6386246caab8faa40b2da221d9ab9b8a, type: 2}
|
stepData: {fileID: 11400000, guid: 6386246caab8faa40b2da221d9ab9b8a, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
|
|||||||
@@ -150,3 +150,5 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: 5700dd3bf16fa9e4aa9905379118d1bd, type: 2}
|
stepData: {fileID: 11400000, guid: 5700dd3bf16fa9e4aa9905379118d1bd, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
|
|||||||
@@ -150,3 +150,5 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: f9da68caaae2a244885a13cf2e2e45c0, type: 2}
|
stepData: {fileID: 11400000, guid: f9da68caaae2a244885a13cf2e2e45c0, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
|
|||||||
@@ -78,3 +78,5 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 0}
|
stepData: {fileID: 0}
|
||||||
|
puzzleIndicator: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
|
|||||||
105
Assets/Prefabs/UI/TestIndicator.prefab
Normal file
105
Assets/Prefabs/UI/TestIndicator.prefab
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &4963699568605073487
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6675530734045362487}
|
||||||
|
- component: {fileID: 6456168790767136091}
|
||||||
|
- component: {fileID: 7639410009611357915}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: TestIndicator
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &6675530734045362487
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4963699568605073487}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: 0.99978626, w: -0.020675343}
|
||||||
|
m_LocalPosition: {x: 46.58, y: -1.77, z: 0}
|
||||||
|
m_LocalScale: {x: -0.1, y: 0.1, z: 0.1}
|
||||||
|
m_ConstrainProportionsScale: 1
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 182.369}
|
||||||
|
--- !u!212 &6456168790767136091
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4963699568605073487}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_Sprite: {fileID: -1067459232888207889, guid: 6767e1e5c0a16f14e926a72a81bf95cb, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 1
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 13.32, y: 12.85}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!114 &7639410009611357915
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4963699568605073487}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 7a691a95f74c07245b64469dda594bfb, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: '::'
|
||||||
7
Assets/Prefabs/UI/TestIndicator.prefab.meta
Normal file
7
Assets/Prefabs/UI/TestIndicator.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cac39b7f8f414e7499e7b672d8710642
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -299,6 +299,14 @@ PrefabInstance:
|
|||||||
propertyPath: stepData
|
propertyPath: stepData
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 11400000, guid: 13b0c411066f85a41ba40c3bbbc281ed, type: 2}
|
objectReference: {fileID: 11400000, guid: 13b0c411066f85a41ba40c3bbbc281ed, type: 2}
|
||||||
|
- target: {fileID: 4778083634590203921, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
propertyPath: indicatorPrefab
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 517425340}
|
||||||
|
- target: {fileID: 4778083634590203921, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
propertyPath: puzzleIndicator
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 517425340}
|
||||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
propertyPath: characterToInteract
|
propertyPath: characterToInteract
|
||||||
value: 1
|
value: 1
|
||||||
@@ -313,7 +321,10 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects:
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 2844046668579196942, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 517425339}
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
--- !u!1 &124275611
|
--- !u!1 &124275611
|
||||||
@@ -578,6 +589,14 @@ PrefabInstance:
|
|||||||
propertyPath: m_Enabled
|
propertyPath: m_Enabled
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4778083634590203921, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
propertyPath: indicatorPrefab
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1398956015}
|
||||||
|
- target: {fileID: 4778083634590203921, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
propertyPath: puzzleIndicator
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1398956015}
|
||||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
propertyPath: isOneTime
|
propertyPath: isOneTime
|
||||||
value: 0
|
value: 0
|
||||||
@@ -592,7 +611,10 @@ PrefabInstance:
|
|||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects:
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 2844046668579196942, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 2027386480}
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
--- !u!1 &384576743
|
--- !u!1 &384576743
|
||||||
@@ -770,6 +792,81 @@ PrefabInstance:
|
|||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
--- !u!1001 &517425338
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransformParent: {fileID: 2102167558}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: TestIndicator
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalScale.x
|
||||||
|
value: -0.02353178
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalScale.y
|
||||||
|
value: 0.024997333
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 0.64
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0.5220351
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: -0.020675343
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0.99978626
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 182.369
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_RemovedGameObjects: []
|
||||||
|
m_AddedGameObjects: []
|
||||||
|
m_AddedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
--- !u!4 &517425339 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 517425338}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!1 &517425340 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 517425338}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!114 &614125440 stripped
|
--- !u!114 &614125440 stripped
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_CorrespondingSourceObject: {fileID: 4573570654593171780, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
|
m_CorrespondingSourceObject: {fileID: 4573570654593171780, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
|
||||||
@@ -1887,6 +1984,11 @@ PrefabInstance:
|
|||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 1631660124}
|
addedObject: {fileID: 1631660124}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||||
|
--- !u!1 &1398956015 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 2027386479}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1 &1443361595
|
--- !u!1 &1443361595
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2556,6 +2658,80 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1001 &2027386479
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransformParent: {fileID: 754397347}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: TestIndicator
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalScale.x
|
||||||
|
value: -0.02
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalScale.y
|
||||||
|
value: 0.022568762
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalScale.z
|
||||||
|
value: 0.36117727
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 0.62
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0.53
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: -0.020675343
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0.99978626
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 182.369
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_RemovedGameObjects: []
|
||||||
|
m_AddedGameObjects: []
|
||||||
|
m_AddedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
--- !u!4 &2027386480 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 2027386479}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!4 &2102167558 stripped
|
--- !u!4 &2102167558 stripped
|
||||||
Transform:
|
Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 2844046668579196942, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
m_CorrespondingSourceObject: {fileID: 2844046668579196942, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||||
|
|||||||
@@ -442044,6 +442044,73 @@ PrefabInstance:
|
|||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 93ab59741ddc4e045a61cd8e05b65578, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 93ab59741ddc4e045a61cd8e05b65578, type: 3}
|
||||||
|
--- !u!1001 &1034525253
|
||||||
|
PrefabInstance:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TransformParent: {fileID: 1267682468}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: TestIndicator
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 5.83
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 7.38814
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: -0.020675343
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: -0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0.99978626
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 182.369
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_RemovedGameObjects: []
|
||||||
|
m_AddedGameObjects: []
|
||||||
|
m_AddedComponents: []
|
||||||
|
m_SourcePrefab: {fileID: 100100000, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
--- !u!1 &1034525254 stripped
|
||||||
|
GameObject:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1034525253}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!4 &1034525255 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 6675530734045362487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 1034525253}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &1042636114
|
--- !u!1001 &1042636114
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -444607,6 +444674,8 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
stepData: {fileID: 11400000, guid: 8ac614a698631554ab8ac39aed04a189, type: 2}
|
stepData: {fileID: 11400000, guid: 8ac614a698631554ab8ac39aed04a189, type: 2}
|
||||||
|
indicatorPrefab: {fileID: 0}
|
||||||
|
drawPromptRangeGizmo: 1
|
||||||
--- !u!114 &1182494941
|
--- !u!114 &1182494941
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -445683,6 +445752,11 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9fba2c868971b20439aaea06a939d8e7, type: 3}
|
m_Script: {fileID: 11500000, guid: 9fba2c868971b20439aaea06a939d8e7, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!4 &1267682468 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 7402687028936857164, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 4912039252317080710}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &1269263373
|
--- !u!1001 &1269263373
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -458506,6 +458580,10 @@ PrefabInstance:
|
|||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2341456216084136881, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
||||||
|
propertyPath: indicatorPrefab
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 1034525254}
|
||||||
- target: {fileID: 2767794910448825193, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
- target: {fileID: 2767794910448825193, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
||||||
propertyPath: isOneTime
|
propertyPath: isOneTime
|
||||||
value: 1
|
value: 1
|
||||||
@@ -458693,7 +458771,10 @@ PrefabInstance:
|
|||||||
m_RemovedComponents:
|
m_RemovedComponents:
|
||||||
- {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
- {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
||||||
m_RemovedGameObjects: []
|
m_RemovedGameObjects: []
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects:
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 7402687028936857164, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 1034525255}
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
|
||||||
--- !u!1001 &5288063114372713135
|
--- !u!1001 &5288063114372713135
|
||||||
|
|||||||
@@ -187,6 +187,11 @@ public class GameManager : MonoBehaviour
|
|||||||
public LayerMask InteractableLayerMask => GetSettings<IInteractionSettings>()?.InteractableLayerMask ?? -1;
|
public LayerMask InteractableLayerMask => GetSettings<IInteractionSettings>()?.InteractableLayerMask ?? -1;
|
||||||
public GameObject BasePickupPrefab => GetSettings<IInteractionSettings>()?.BasePickupPrefab;
|
public GameObject BasePickupPrefab => GetSettings<IInteractionSettings>()?.BasePickupPrefab;
|
||||||
public GameObject LevelSwitchMenuPrefab => GetSettings<IInteractionSettings>()?.LevelSwitchMenuPrefab;
|
public GameObject LevelSwitchMenuPrefab => GetSettings<IInteractionSettings>()?.LevelSwitchMenuPrefab;
|
||||||
|
|
||||||
|
// PUZZLE SETTINGS
|
||||||
|
|
||||||
|
public float DefaultPuzzlePromptRange => GetSettings<IInteractionSettings>()?.DefaultPuzzlePromptRange ?? 3.0f;
|
||||||
|
public GameObject DefaultPuzzleIndicatorPrefab => GetSettings<IInteractionSettings>()?.DefaultPuzzleIndicatorPrefab;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the combination rule for two items, if any.
|
/// Returns the combination rule for two items, if any.
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ namespace AppleHills.Core.Settings
|
|||||||
[SerializeField] private GameObject basePickupPrefab;
|
[SerializeField] private GameObject basePickupPrefab;
|
||||||
[SerializeField] private GameObject levelSwitchMenuPrefab;
|
[SerializeField] private GameObject levelSwitchMenuPrefab;
|
||||||
|
|
||||||
|
[Header("Puzzle Settings")]
|
||||||
|
[Tooltip("Default prefab for puzzle step indicators")]
|
||||||
|
[SerializeField] private GameObject defaultPuzzleIndicatorPrefab;
|
||||||
|
[Tooltip("Default range for puzzle prompts")]
|
||||||
|
[SerializeField] private float defaultPuzzlePromptRange = 3.0f;
|
||||||
|
|
||||||
[Header("Item Configuration")]
|
[Header("Item Configuration")]
|
||||||
[SerializeField] private List<CombinationRule> combinationRules = new List<CombinationRule>();
|
[SerializeField] private List<CombinationRule> combinationRules = new List<CombinationRule>();
|
||||||
[SerializeField] private List<SlotItemConfig> slotItemConfigs = new List<SlotItemConfig>();
|
[SerializeField] private List<SlotItemConfig> slotItemConfigs = new List<SlotItemConfig>();
|
||||||
@@ -35,6 +41,8 @@ namespace AppleHills.Core.Settings
|
|||||||
public GameObject LevelSwitchMenuPrefab => levelSwitchMenuPrefab;
|
public GameObject LevelSwitchMenuPrefab => levelSwitchMenuPrefab;
|
||||||
public List<CombinationRule> CombinationRules => combinationRules;
|
public List<CombinationRule> CombinationRules => combinationRules;
|
||||||
public List<SlotItemConfig> SlotItemConfigs => slotItemConfigs;
|
public List<SlotItemConfig> SlotItemConfigs => slotItemConfigs;
|
||||||
|
public GameObject DefaultPuzzleIndicatorPrefab => defaultPuzzleIndicatorPrefab;
|
||||||
|
public float DefaultPuzzlePromptRange => defaultPuzzlePromptRange;
|
||||||
|
|
||||||
public override void OnValidate()
|
public override void OnValidate()
|
||||||
{
|
{
|
||||||
@@ -43,6 +51,7 @@ namespace AppleHills.Core.Settings
|
|||||||
playerStopDistance = Mathf.Max(0.1f, playerStopDistance);
|
playerStopDistance = Mathf.Max(0.1f, playerStopDistance);
|
||||||
playerStopDistanceDirectInteraction = Mathf.Max(0.1f, playerStopDistanceDirectInteraction);
|
playerStopDistanceDirectInteraction = Mathf.Max(0.1f, playerStopDistanceDirectInteraction);
|
||||||
followerPickupDelay = Mathf.Max(0f, followerPickupDelay);
|
followerPickupDelay = Mathf.Max(0f, followerPickupDelay);
|
||||||
|
defaultPuzzlePromptRange = Mathf.Max(0.1f, defaultPuzzlePromptRange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ namespace AppleHills.Core.Settings
|
|||||||
GameObject LevelSwitchMenuPrefab { get; }
|
GameObject LevelSwitchMenuPrefab { get; }
|
||||||
List<CombinationRule> CombinationRules { get; }
|
List<CombinationRule> CombinationRules { get; }
|
||||||
List<SlotItemConfig> SlotItemConfigs { get; }
|
List<SlotItemConfig> SlotItemConfigs { get; }
|
||||||
|
|
||||||
|
// Puzzle settings
|
||||||
|
GameObject DefaultPuzzleIndicatorPrefab { get; }
|
||||||
|
float DefaultPuzzlePromptRange { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -13,17 +13,20 @@ namespace AppleHills
|
|||||||
// Static delegates that will be set by editor code
|
// Static delegates that will be set by editor code
|
||||||
private static GetSettingsValueDelegate getPlayerStopDistanceProvider;
|
private static GetSettingsValueDelegate getPlayerStopDistanceProvider;
|
||||||
private static GetSettingsValueDelegate getPlayerStopDistanceDirectInteractionProvider;
|
private static GetSettingsValueDelegate getPlayerStopDistanceDirectInteractionProvider;
|
||||||
|
private static GetSettingsValueDelegate getPuzzlePromptRangeProvider;
|
||||||
|
|
||||||
// Editor-only method to set up providers - will be called from editor code
|
// Editor-only method to set up providers - will be called from editor code
|
||||||
public static void SetupEditorProviders(
|
public static void SetupEditorProviders(
|
||||||
GetSettingsValueDelegate playerStopDistanceProvider,
|
GetSettingsValueDelegate playerStopDistanceProvider,
|
||||||
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider)
|
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider,
|
||||||
|
GetSettingsValueDelegate puzzlePromptRangeProvider)
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying)
|
if (!Application.isPlaying)
|
||||||
{
|
{
|
||||||
getPlayerStopDistanceProvider = playerStopDistanceProvider;
|
getPlayerStopDistanceProvider = playerStopDistanceProvider;
|
||||||
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
||||||
|
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -52,6 +55,18 @@ namespace AppleHills
|
|||||||
return GameManager.Instance.PlayerStopDistanceDirectInteraction;
|
return GameManager.Instance.PlayerStopDistanceDirectInteraction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float GetPuzzlePromptRange()
|
||||||
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (!Application.isPlaying && getPuzzlePromptRangeProvider != null)
|
||||||
|
{
|
||||||
|
return getPuzzlePromptRangeProvider();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return GameManager.Instance.DefaultPuzzlePromptRange;
|
||||||
|
}
|
||||||
|
|
||||||
// Add more methods as needed for other settings
|
// Add more methods as needed for other settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ namespace Interactions
|
|||||||
// the correct item we're looking for
|
// the correct item we're looking for
|
||||||
var config = GameManager.Instance.GetSlotItemConfig(itemData);
|
var config = GameManager.Instance.GetSlotItemConfig(itemData);
|
||||||
var allowed = config?.allowedItems ?? new List<PickupItemData>();
|
var allowed = config?.allowedItems ?? new List<PickupItemData>();
|
||||||
if (PickupItemData.ListContainsEquivalent(allowed, itemToSlotData))
|
if (itemToSlotData != null && PickupItemData.ListContainsEquivalent(allowed, itemToSlotData))
|
||||||
{
|
{
|
||||||
if (itemToSlot != null)
|
if (itemToSlot != null)
|
||||||
{
|
{
|
||||||
|
|||||||
41
Assets/Scripts/PuzzleS/IPuzzlePrompt.cs
Normal file
41
Assets/Scripts/PuzzleS/IPuzzlePrompt.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace PuzzleS
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for proximity-based puzzle prompts that can show far/close indicators
|
||||||
|
/// based on player distance.
|
||||||
|
/// </summary>
|
||||||
|
public interface IPuzzlePrompt
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the prompt should be initially shown (e.g., when step is unlocked)
|
||||||
|
/// </summary>
|
||||||
|
void OnShow();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the prompt should be hidden (e.g., when step is locked)
|
||||||
|
/// </summary>
|
||||||
|
void OnHide();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the player enters the outer range of the prompt.
|
||||||
|
/// </summary>
|
||||||
|
void ShowFar();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the player enters the inner range of the prompt.
|
||||||
|
/// </summary>
|
||||||
|
void ShowClose();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the player exits the inner range of the prompt.
|
||||||
|
/// </summary>
|
||||||
|
void HideClose();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the player exits the outer range of the prompt.
|
||||||
|
/// </summary>
|
||||||
|
void HideFar();
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/PuzzleS/IPuzzlePrompt.cs.meta
Normal file
3
Assets/Scripts/PuzzleS/IPuzzlePrompt.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 84466e5dfeeb4908adf7f0f1f2b82531
|
||||||
|
timeCreated: 1759312472
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
using Input;
|
using Input;
|
||||||
using Interactions;
|
using Interactions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System;
|
||||||
|
using AppleHills.Core.Settings;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
|
||||||
namespace PuzzleS
|
namespace PuzzleS
|
||||||
{
|
{
|
||||||
@@ -8,14 +11,26 @@ namespace PuzzleS
|
|||||||
/// Manages the state and interactions for a single puzzle step, including unlock/lock logic and event handling.
|
/// Manages the state and interactions for a single puzzle step, including unlock/lock logic and event handling.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RequireComponent(typeof(Interactable))]
|
[RequireComponent(typeof(Interactable))]
|
||||||
public class ObjectiveStepBehaviour : MonoBehaviour
|
public class ObjectiveStepBehaviour : MonoBehaviour, IPuzzlePrompt
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The data object representing this puzzle step.
|
/// The data object representing this puzzle step.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PuzzleStepSO stepData;
|
public PuzzleStepSO stepData;
|
||||||
|
|
||||||
|
[Header("Indicator Settings")]
|
||||||
|
[SerializeField] private GameObject puzzleIndicator;
|
||||||
|
[SerializeField] private bool drawPromptRangeGizmo = true;
|
||||||
|
|
||||||
private Interactable _interactable;
|
private Interactable _interactable;
|
||||||
private bool _isUnlocked = false;
|
private bool _isUnlocked = false;
|
||||||
|
private IPuzzlePrompt _indicator;
|
||||||
|
|
||||||
|
// Current proximity state tracked by PuzzleManager
|
||||||
|
private ProximityState _currentProximityState = ProximityState.Far;
|
||||||
|
|
||||||
|
// Enum for tracking proximity state (simplified to just Close and Far)
|
||||||
|
public enum ProximityState { Close, Far }
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
@@ -48,6 +63,139 @@ namespace PuzzleS
|
|||||||
}
|
}
|
||||||
PuzzleManager.Instance?.UnregisterStepBehaviour(this);
|
PuzzleManager.Instance?.UnregisterStepBehaviour(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the proximity state from PuzzleManager and triggers appropriate methods.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newState">The new proximity state.</param>
|
||||||
|
public void UpdateProximityState(ProximityState newState)
|
||||||
|
{
|
||||||
|
if (_currentProximityState == newState) return;
|
||||||
|
|
||||||
|
// Determine state changes and call appropriate methods
|
||||||
|
if (newState == ProximityState.Close)
|
||||||
|
{
|
||||||
|
// Transitioning from Far to Close
|
||||||
|
ShowClose();
|
||||||
|
}
|
||||||
|
else // newState == ProximityState.Far
|
||||||
|
{
|
||||||
|
// Transitioning from Close to Far
|
||||||
|
HideClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentProximityState = newState;
|
||||||
|
}
|
||||||
|
|
||||||
|
// IPuzzlePrompt interface implementation - delegates to indicator if available
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the prompt should be initially shown (e.g., when step is unlocked)
|
||||||
|
/// </summary>
|
||||||
|
public virtual void OnShow()
|
||||||
|
{
|
||||||
|
// Delegate to indicator if available
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.OnShow();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default fallback behavior
|
||||||
|
Debug.Log($"[Puzzles] Prompt shown for {stepData?.stepId} on {gameObject.name}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the prompt should be hidden (e.g., when step is locked)
|
||||||
|
/// </summary>
|
||||||
|
public virtual void OnHide()
|
||||||
|
{
|
||||||
|
// Delegate to indicator if available
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.OnHide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default fallback behavior
|
||||||
|
Debug.Log($"[Puzzles] Prompt hidden for {stepData?.stepId} on {gameObject.name}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when player enters the far range
|
||||||
|
/// </summary>
|
||||||
|
public virtual void ShowFar()
|
||||||
|
{
|
||||||
|
// Only show if step is unlocked
|
||||||
|
if (!_isUnlocked) return;
|
||||||
|
|
||||||
|
// Delegate to indicator if available
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.ShowFar();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default fallback behavior
|
||||||
|
Debug.Log($"[Puzzles] Player entered far range of {stepData?.stepId} on {gameObject.name}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when player enters the close range
|
||||||
|
/// </summary>
|
||||||
|
public virtual void ShowClose()
|
||||||
|
{
|
||||||
|
// Only show if step is unlocked
|
||||||
|
if (!_isUnlocked) return;
|
||||||
|
|
||||||
|
// Delegate to indicator if available
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.ShowClose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default fallback behavior
|
||||||
|
Debug.Log($"[Puzzles] Player entered close range of {stepData?.stepId} on {gameObject.name}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when player exits the close range
|
||||||
|
/// </summary>
|
||||||
|
public virtual void HideClose()
|
||||||
|
{
|
||||||
|
// Only respond if step is unlocked
|
||||||
|
if (!_isUnlocked) return;
|
||||||
|
|
||||||
|
// Delegate to indicator if available
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.HideClose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default fallback behavior
|
||||||
|
Debug.Log($"[Puzzles] Player exited close range of {stepData?.stepId} on {gameObject.name}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when player exits the far range
|
||||||
|
/// </summary>
|
||||||
|
public virtual void HideFar()
|
||||||
|
{
|
||||||
|
// Only respond if step is unlocked
|
||||||
|
if (!_isUnlocked) return;
|
||||||
|
|
||||||
|
// Delegate to indicator if available
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.HideFar();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default fallback behavior
|
||||||
|
Debug.Log($"[Puzzles] Player exited far range of {stepData?.stepId} on {gameObject.name}");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unlocks this puzzle step, allowing interaction.
|
/// Unlocks this puzzle step, allowing interaction.
|
||||||
@@ -56,7 +204,56 @@ namespace PuzzleS
|
|||||||
{
|
{
|
||||||
_isUnlocked = true;
|
_isUnlocked = true;
|
||||||
Debug.Log($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}");
|
Debug.Log($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}");
|
||||||
// Optionally, show visual feedback for unlocked state
|
|
||||||
|
// Show indicator if enabled in settings
|
||||||
|
if (puzzleIndicator != null)
|
||||||
|
{
|
||||||
|
// Try to get the IPuzzlePrompt component from the spawned indicator
|
||||||
|
_indicator = puzzleIndicator.GetComponent<IPuzzlePrompt>();
|
||||||
|
|
||||||
|
if (_indicator == null)
|
||||||
|
{
|
||||||
|
// Try to find it in children if not on the root
|
||||||
|
_indicator = puzzleIndicator.GetComponentInChildren<IPuzzlePrompt>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_indicator == null)
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// First show the indicator
|
||||||
|
_indicator.OnShow();
|
||||||
|
|
||||||
|
// Then set the correct state based on current player distance
|
||||||
|
Transform playerTransform = GameObject.FindGameObjectWithTag("Player")?.transform;
|
||||||
|
if (playerTransform != null)
|
||||||
|
{
|
||||||
|
float distance = Vector3.Distance(transform.position, playerTransform.position);
|
||||||
|
float promptRange = AppleHills.SettingsAccess.GetPuzzlePromptRange();
|
||||||
|
|
||||||
|
if (distance <= promptRange)
|
||||||
|
{
|
||||||
|
// Player is in close range
|
||||||
|
_currentProximityState = ProximityState.Close;
|
||||||
|
_indicator.ShowClose();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Player is in far range
|
||||||
|
_currentProximityState = ProximityState.Far;
|
||||||
|
_indicator.ShowFar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Default to far if player not found
|
||||||
|
_currentProximityState = ProximityState.Far;
|
||||||
|
_indicator.ShowFar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -66,7 +263,12 @@ namespace PuzzleS
|
|||||||
{
|
{
|
||||||
_isUnlocked = false;
|
_isUnlocked = false;
|
||||||
Debug.Log($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
|
Debug.Log($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
|
||||||
// Optionally, show visual feedback for locked state
|
|
||||||
|
// Hide indicator
|
||||||
|
if (_indicator != null)
|
||||||
|
{
|
||||||
|
_indicator.OnHide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -98,5 +300,20 @@ namespace PuzzleS
|
|||||||
PuzzleManager.Instance?.MarkPuzzleStepCompleted(stepData);
|
PuzzleManager.Instance?.MarkPuzzleStepCompleted(stepData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Visualizes the puzzle prompt ranges in the editor.
|
||||||
|
/// </summary>
|
||||||
|
private void OnDrawGizmos()
|
||||||
|
{
|
||||||
|
if (!drawPromptRangeGizmo) return;
|
||||||
|
|
||||||
|
// Use the global puzzle prompt range from settings
|
||||||
|
float promptRange = AppleHills.SettingsAccess.GetPuzzlePromptRange();
|
||||||
|
|
||||||
|
// Draw threshold circle
|
||||||
|
Gizmos.color = Color.cyan;
|
||||||
|
Gizmos.DrawWireSphere(transform.position, promptRange / 2f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -14,6 +15,12 @@ namespace PuzzleS
|
|||||||
private static PuzzleManager _instance;
|
private static PuzzleManager _instance;
|
||||||
private static bool _isQuitting;
|
private static bool _isQuitting;
|
||||||
|
|
||||||
|
[SerializeField] private float proximityCheckInterval = 0.02f;
|
||||||
|
|
||||||
|
// Reference to player transform for proximity calculations
|
||||||
|
private Transform _playerTransform;
|
||||||
|
private Coroutine _proximityCheckCoroutine;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Singleton instance of the PuzzleManager.
|
/// Singleton instance of the PuzzleManager.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -53,9 +60,19 @@ namespace PuzzleS
|
|||||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
// Find player transform
|
||||||
|
_playerTransform = GameObject.FindGameObjectWithTag("Player")?.transform;
|
||||||
|
|
||||||
|
// Start proximity check coroutine
|
||||||
|
StartProximityChecks();
|
||||||
|
}
|
||||||
|
|
||||||
void OnDestroy()
|
void OnDestroy()
|
||||||
{
|
{
|
||||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||||
|
StopProximityChecks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||||
@@ -66,6 +83,69 @@ namespace PuzzleS
|
|||||||
_runtimeDependencies.Clear();
|
_runtimeDependencies.Clear();
|
||||||
BuildRuntimeDependencies();
|
BuildRuntimeDependencies();
|
||||||
UnlockInitialSteps();
|
UnlockInitialSteps();
|
||||||
|
|
||||||
|
// Find player transform again in case it changed with scene load
|
||||||
|
_playerTransform = GameObject.FindGameObjectWithTag("Player")?.transform;
|
||||||
|
|
||||||
|
// Restart proximity checks
|
||||||
|
StartProximityChecks();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start the proximity check coroutine.
|
||||||
|
/// </summary>
|
||||||
|
private void StartProximityChecks()
|
||||||
|
{
|
||||||
|
StopProximityChecks();
|
||||||
|
_proximityCheckCoroutine = StartCoroutine(CheckProximityRoutine());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stop the proximity check coroutine.
|
||||||
|
/// </summary>
|
||||||
|
private void StopProximityChecks()
|
||||||
|
{
|
||||||
|
if (_proximityCheckCoroutine != null)
|
||||||
|
{
|
||||||
|
StopCoroutine(_proximityCheckCoroutine);
|
||||||
|
_proximityCheckCoroutine = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Coroutine that periodically checks player proximity to all puzzle steps.
|
||||||
|
/// </summary>
|
||||||
|
private IEnumerator CheckProximityRoutine()
|
||||||
|
{
|
||||||
|
WaitForSeconds wait = new WaitForSeconds(proximityCheckInterval);
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
if (_playerTransform != null)
|
||||||
|
{
|
||||||
|
// Get the proximity threshold from settings (half of the prompt range)
|
||||||
|
float proximityThreshold = GameManager.Instance.DefaultPuzzlePromptRange;
|
||||||
|
|
||||||
|
// Check distance to each step behavior
|
||||||
|
foreach (var kvp in _stepBehaviours)
|
||||||
|
{
|
||||||
|
if (kvp.Value == null) continue;
|
||||||
|
|
||||||
|
float distance = Vector3.Distance(_playerTransform.position, kvp.Value.transform.position);
|
||||||
|
|
||||||
|
// Determine the proximity state - only Close or Far now
|
||||||
|
ObjectiveStepBehaviour.ProximityState state =
|
||||||
|
(distance <= proximityThreshold)
|
||||||
|
? ObjectiveStepBehaviour.ProximityState.Close
|
||||||
|
: ObjectiveStepBehaviour.ProximityState.Far;
|
||||||
|
|
||||||
|
// Update the step's proximity state
|
||||||
|
kvp.Value.UpdateProximityState(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return wait;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -29,4 +29,19 @@ public class PuzzleStepSO : ScriptableObject
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Header("Unlocks")]
|
[Header("Unlocks")]
|
||||||
public List<PuzzleStepSO> unlocks = new List<PuzzleStepSO>();
|
public List<PuzzleStepSO> unlocks = new List<PuzzleStepSO>();
|
||||||
|
|
||||||
|
[Header("Interaction Settings")]
|
||||||
|
[Tooltip("Whether to show an indicator when this step is unlocked")]
|
||||||
|
[SerializeField] private bool showIndicator = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to show an indicator when this step is unlocked.
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowIndicator => showIndicator;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets whether to show an indicator.
|
||||||
|
/// </summary>
|
||||||
|
public bool GetShowIndicator() => showIndicator;
|
||||||
|
public void SetShowIndicator(bool value) => showIndicator = value;
|
||||||
}
|
}
|
||||||
|
|||||||
46
Assets/Scripts/UI/TestIndicator.cs
Normal file
46
Assets/Scripts/UI/TestIndicator.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class TestIndicator : MonoBehaviour, PuzzleS.IPuzzlePrompt
|
||||||
|
{
|
||||||
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnShow()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHide()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowFar()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowClose()
|
||||||
|
{
|
||||||
|
gameObject.transform.localScale = new Vector3(-0.2f, 0.2f, 0.2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HideClose()
|
||||||
|
{
|
||||||
|
gameObject.transform.localScale = new Vector3(-0.1f, 0.1f, 0.1f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void HideFar()
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/UI/TestIndicator.cs.meta
Normal file
2
Assets/Scripts/UI/TestIndicator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a691a95f74c07245b64469dda594bfb
|
||||||
@@ -20,6 +20,8 @@ MonoBehaviour:
|
|||||||
m_Bits: 1024
|
m_Bits: 1024
|
||||||
basePickupPrefab: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
basePickupPrefab: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||||
levelSwitchMenuPrefab: {fileID: 4062459998181038721, guid: de2ed28e4200a4340a5af4086c98a0dc, type: 3}
|
levelSwitchMenuPrefab: {fileID: 4062459998181038721, guid: de2ed28e4200a4340a5af4086c98a0dc, type: 3}
|
||||||
|
defaultPuzzleIndicatorPrefab: {fileID: 4963699568605073487, guid: cac39b7f8f414e7499e7b672d8710642, type: 3}
|
||||||
|
defaultPuzzlePromptRange: 10
|
||||||
combinationRules:
|
combinationRules:
|
||||||
- itemA: {fileID: 11400000, guid: 8b2616beb14825a46b9b1ed85ad3cb25, type: 2}
|
- itemA: {fileID: 11400000, guid: 8b2616beb14825a46b9b1ed85ad3cb25, type: 2}
|
||||||
itemB: {fileID: 11400000, guid: 33e7ca06b22108d4e802486e08bcdfd1, type: 2}
|
itemB: {fileID: 11400000, guid: 33e7ca06b22108d4e802486e08bcdfd1, type: 2}
|
||||||
|
|||||||
Reference in New Issue
Block a user