Add editor accses to outline colors
This commit is contained in:
@@ -30,7 +30,8 @@ namespace AppleHills.Editor
|
|||||||
GetPlayerStopDistance,
|
GetPlayerStopDistance,
|
||||||
GetPlayerStopDistanceDirectInteraction,
|
GetPlayerStopDistanceDirectInteraction,
|
||||||
GetPuzzlePromptRange,
|
GetPuzzlePromptRange,
|
||||||
GetWeakPointExplosionRadius
|
GetWeakPointExplosionRadius,
|
||||||
|
GetInteractionOutlineColors
|
||||||
);
|
);
|
||||||
|
|
||||||
// Subscribe to asset changes to auto-refresh when settings are modified
|
// Subscribe to asset changes to auto-refresh when settings are modified
|
||||||
@@ -74,7 +75,8 @@ namespace AppleHills.Editor
|
|||||||
GetPlayerStopDistance,
|
GetPlayerStopDistance,
|
||||||
GetPlayerStopDistanceDirectInteraction,
|
GetPlayerStopDistanceDirectInteraction,
|
||||||
GetPuzzlePromptRange,
|
GetPuzzlePromptRange,
|
||||||
GetWeakPointExplosionRadius
|
GetWeakPointExplosionRadius,
|
||||||
|
GetInteractionOutlineColors
|
||||||
);
|
);
|
||||||
|
|
||||||
Logging.Debug("Editor settings loaded for Scene View use");
|
Logging.Debug("Editor settings loaded for Scene View use");
|
||||||
@@ -108,6 +110,12 @@ namespace AppleHills.Editor
|
|||||||
return _fortFightSettings?.WeakPointExplosionRadius ?? 2.5f;
|
return _fortFightSettings?.WeakPointExplosionRadius ?? 2.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Interaction Settings delegate methods
|
||||||
|
private static System.Collections.Generic.List<GlowOutlineData> GetInteractionOutlineColors()
|
||||||
|
{
|
||||||
|
return _interactionSettings?.InteractionOutlineColors;
|
||||||
|
}
|
||||||
|
|
||||||
// Other utility methods
|
// Other utility methods
|
||||||
public static T GetSettings<T>() where T : BaseSettings
|
public static T GetSettings<T>() where T : BaseSettings
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,19 +10,22 @@ namespace AppleHills
|
|||||||
{
|
{
|
||||||
// Delegate type for editor-only settings providers
|
// Delegate type for editor-only settings providers
|
||||||
public delegate float GetSettingsValueDelegate();
|
public delegate float GetSettingsValueDelegate();
|
||||||
|
public delegate System.Collections.Generic.List<GlowOutlineData> GetOutlineColorsDelegate();
|
||||||
|
|
||||||
// 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;
|
private static GetSettingsValueDelegate getPuzzlePromptRangeProvider;
|
||||||
private static GetSettingsValueDelegate getWeakPointExplosionRadiusProvider;
|
private static GetSettingsValueDelegate getWeakPointExplosionRadiusProvider;
|
||||||
|
private static GetOutlineColorsDelegate getInteractionOutlineColorsProvider;
|
||||||
|
|
||||||
// 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,
|
GetSettingsValueDelegate puzzlePromptRangeProvider,
|
||||||
GetSettingsValueDelegate weakPointExplosionRadiusProvider)
|
GetSettingsValueDelegate weakPointExplosionRadiusProvider,
|
||||||
|
GetOutlineColorsDelegate interactionOutlineColorsProvider)
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying)
|
if (!Application.isPlaying)
|
||||||
@@ -31,6 +34,7 @@ namespace AppleHills
|
|||||||
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
||||||
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
|
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
|
||||||
getWeakPointExplosionRadiusProvider = weakPointExplosionRadiusProvider;
|
getWeakPointExplosionRadiusProvider = weakPointExplosionRadiusProvider;
|
||||||
|
getInteractionOutlineColorsProvider = interactionOutlineColorsProvider;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -89,6 +93,20 @@ namespace AppleHills
|
|||||||
return GameManager.Instance.WeakPointExplosionRadius;
|
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
|
// Add more methods as needed for other settings
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user