Add editor accses to outline colors

This commit is contained in:
Michal Pikulski
2025-12-11 13:31:36 +01:00
parent 02e450271e
commit 8e1fa9fb97
2 changed files with 29 additions and 3 deletions

View File

@@ -10,19 +10,22 @@ namespace AppleHills
{
// Delegate type for editor-only settings providers
public delegate float GetSettingsValueDelegate();
public delegate System.Collections.Generic.List<GlowOutlineData> GetOutlineColorsDelegate();
// Static delegates that will be set by editor code
private static GetSettingsValueDelegate getPlayerStopDistanceProvider;
private static GetSettingsValueDelegate getPlayerStopDistanceDirectInteractionProvider;
private static GetSettingsValueDelegate getPuzzlePromptRangeProvider;
private static GetSettingsValueDelegate getWeakPointExplosionRadiusProvider;
private static GetOutlineColorsDelegate getInteractionOutlineColorsProvider;
// Editor-only method to set up providers - will be called from editor code
public static void SetupEditorProviders(
GetSettingsValueDelegate playerStopDistanceProvider,
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider,
GetSettingsValueDelegate puzzlePromptRangeProvider,
GetSettingsValueDelegate weakPointExplosionRadiusProvider)
GetSettingsValueDelegate weakPointExplosionRadiusProvider,
GetOutlineColorsDelegate interactionOutlineColorsProvider)
{
#if UNITY_EDITOR
if (!Application.isPlaying)
@@ -31,6 +34,7 @@ namespace AppleHills
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
getWeakPointExplosionRadiusProvider = weakPointExplosionRadiusProvider;
getInteractionOutlineColorsProvider = interactionOutlineColorsProvider;
}
#endif
}
@@ -89,6 +93,20 @@ namespace AppleHills
return GameManager.Instance.WeakPointExplosionRadius;
}
// Interaction Settings
public static System.Collections.Generic.List<GlowOutlineData> GetInteractionOutlineColors()
{
#if UNITY_EDITOR
if (!Application.isPlaying && getInteractionOutlineColorsProvider != null)
{
return getInteractionOutlineColorsProvider();
}
#endif
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IInteractionSettings>();
return settings?.InteractionOutlineColors;
}
// Add more methods as needed for other settings
/// <summary>