From 02e450271e24cf03851d9b7fc2708d9c7a8f075a Mon Sep 17 00:00:00 2001 From: journaliciouz Date: Thu, 11 Dec 2025 13:23:46 +0100 Subject: [PATCH] Added outline settings --- Assets/Scenes/Levels/Quarry.unity | 117 +++++++++++++++++- .../Core/Settings/InteractionSettings.cs | 3 + .../Core/Settings/SettingsInterfaces.cs | 3 +- Assets/Scripts/Interactions/GlowOutline.cs | 33 +++++ .../Scripts/Interactions/GlowOutline.cs.meta | 2 + .../Scripts/Interactions/GlowOutlineData.cs | 9 ++ .../Interactions/GlowOutlineData.cs.meta | 2 + Assets/Settings/InteractionSettings.asset | 7 ++ 8 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 Assets/Scripts/Interactions/GlowOutline.cs create mode 100644 Assets/Scripts/Interactions/GlowOutline.cs.meta create mode 100644 Assets/Scripts/Interactions/GlowOutlineData.cs create mode 100644 Assets/Scripts/Interactions/GlowOutlineData.cs.meta diff --git a/Assets/Scenes/Levels/Quarry.unity b/Assets/Scenes/Levels/Quarry.unity index 2ee1a939..a3115249 100644 --- a/Assets/Scenes/Levels/Quarry.unity +++ b/Assets/Scenes/Levels/Quarry.unity @@ -433672,6 +433672,118 @@ MonoBehaviour: audioSource: {fileID: 0} clipPriority: 0 sourcePriority: 0 +--- !u!1 &338747595 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 338747596} + - component: {fileID: 338747598} + - component: {fileID: 338747597} + m_Layer: 0 + m_Name: GlowOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &338747596 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338747595} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1046094549} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &338747597 +SpriteRenderer: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338747595} + 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: 9dfc825aed78fcd4ba02077103263b40, 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_MaskInteraction: 0 + m_Sprite: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 0 + m_SpriteSortPoint: 0 +--- !u!114 &338747598 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338747595} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0f935b14e8862e249bdc2bde13bc19fd, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + scaleFactor: 0 + outlineModes: + - interaction: 0 + outlineColour: {r: 1, g: 0.87843144, b: 0.57254905, a: 0} + - interaction: 1 + outlineColour: {r: 0.5058824, g: 0.7803922, b: 0.8862746, a: 0} + - interaction: 2 + outlineColour: {r: 1, g: 0.87843144, b: 0.57254905, a: 0} --- !u!1 &341893678 GameObject: m_ObjectHideFlags: 0 @@ -447736,6 +447848,7 @@ Transform: - {fileID: 2089128782} - {fileID: 768267914} - {fileID: 1351976589} + - {fileID: 338747596} m_Father: {fileID: 1471606854} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1046094550 @@ -449659,11 +449772,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8361739881193827101, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} propertyPath: m_LocalPosition.x - value: 7.4399986 + value: 7.439999 objectReference: {fileID: 0} - target: {fileID: 8361739881193827101, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} propertyPath: m_LocalPosition.y - value: 11.469999 + value: 11.47 objectReference: {fileID: 0} - target: {fileID: 9074453772172382270, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} propertyPath: lawnMowerRef diff --git a/Assets/Scripts/Core/Settings/InteractionSettings.cs b/Assets/Scripts/Core/Settings/InteractionSettings.cs index 4783dc9a..12c66cb7 100644 --- a/Assets/Scripts/Core/Settings/InteractionSettings.cs +++ b/Assets/Scripts/Core/Settings/InteractionSettings.cs @@ -14,6 +14,7 @@ namespace AppleHills.Core.Settings [SerializeField] private float playerStopDistance = 6.0f; [SerializeField] private float playerStopDistanceDirectInteraction = 2.0f; [SerializeField] private float followerPickupDelay = 0.2f; + [SerializeField] private List interactionOutlineColors; [Header("InputManager Settings")] [Tooltip("Layer(s) to use for interactable objects.")] @@ -47,6 +48,8 @@ namespace AppleHills.Core.Settings public GameObject DefaultPuzzleIndicatorPrefab => defaultPuzzleIndicatorPrefab; public float DefaultPuzzlePromptRange => defaultPuzzlePromptRange; + public List InteractionOutlineColors => interactionOutlineColors; + public override void OnValidate() { base.OnValidate(); diff --git a/Assets/Scripts/Core/Settings/SettingsInterfaces.cs b/Assets/Scripts/Core/Settings/SettingsInterfaces.cs index c9c1318c..65adcde8 100644 --- a/Assets/Scripts/Core/Settings/SettingsInterfaces.cs +++ b/Assets/Scripts/Core/Settings/SettingsInterfaces.cs @@ -66,7 +66,8 @@ namespace AppleHills.Core.Settings GameObject MinigameSwitchMenuPrefab { get; } List CombinationRules { get; } List SlotItemConfigs { get; } - + List InteractionOutlineColors { get; } + // Puzzle settings GameObject DefaultPuzzleIndicatorPrefab { get; } float DefaultPuzzlePromptRange { get; } diff --git a/Assets/Scripts/Interactions/GlowOutline.cs b/Assets/Scripts/Interactions/GlowOutline.cs new file mode 100644 index 00000000..cb5e6350 --- /dev/null +++ b/Assets/Scripts/Interactions/GlowOutline.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +public class GlowOutline : MonoBehaviour +{ + + private SpriteRenderer parentSprite; + private SpriteRenderer outlineSprite; + + + public float scaleFactor; + public GlowOutlineData[] outlineModes; + + + + private void OnEnable() + { + SetupOutline(); + } + + + private void SetupOutline() + { + parentSprite = GetComponentInParent(); + outlineSprite = GetComponent(); + + outlineSprite.sprite = parentSprite.sprite; + gameObject.transform.localScale = gameObject.transform.localScale * scaleFactor; + //outlineSprite.color = outlineColour; + } + +} diff --git a/Assets/Scripts/Interactions/GlowOutline.cs.meta b/Assets/Scripts/Interactions/GlowOutline.cs.meta new file mode 100644 index 00000000..b75eae72 --- /dev/null +++ b/Assets/Scripts/Interactions/GlowOutline.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0f935b14e8862e249bdc2bde13bc19fd \ No newline at end of file diff --git a/Assets/Scripts/Interactions/GlowOutlineData.cs b/Assets/Scripts/Interactions/GlowOutlineData.cs new file mode 100644 index 00000000..ab4cb028 --- /dev/null +++ b/Assets/Scripts/Interactions/GlowOutlineData.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +[System.Serializable] +public class GlowOutlineData +{ + public enum InteractionType { Pickup, Combine, Interaction }; + public InteractionType interaction; + public Color outlineColour; +} diff --git a/Assets/Scripts/Interactions/GlowOutlineData.cs.meta b/Assets/Scripts/Interactions/GlowOutlineData.cs.meta new file mode 100644 index 00000000..72105050 --- /dev/null +++ b/Assets/Scripts/Interactions/GlowOutlineData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e30fc1ed343c85742bc48b4c75fb6fbf \ No newline at end of file diff --git a/Assets/Settings/InteractionSettings.asset b/Assets/Settings/InteractionSettings.asset index be61451d..4dd248ef 100644 --- a/Assets/Settings/InteractionSettings.asset +++ b/Assets/Settings/InteractionSettings.asset @@ -15,6 +15,13 @@ MonoBehaviour: playerStopDistance: 10 playerStopDistanceDirectInteraction: 5 followerPickupDelay: 0.2 + interactionOutlineColors: + - interaction: 0 + outlineColour: {r: 1, g: 0.87843144, b: 0.57254905, a: 0} + - interaction: 1 + outlineColour: {r: 0.5058824, g: 0.7803922, b: 0.8862746, a: 0} + - interaction: 2 + outlineColour: {r: 0.62352943, g: 0.62352943, b: 0.8078432, a: 0} interactableLayerMask: serializedVersion: 2 m_Bits: 1024