2025-10-24 11:09:32 +00:00
|
|
|
|
using Core;
|
|
|
|
|
|
using UnityEngine;
|
2025-09-24 13:33:43 +00:00
|
|
|
|
|
|
|
|
|
|
namespace AppleHills
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Unified access to settings in both editor and play mode
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class SettingsAccess
|
|
|
|
|
|
{
|
|
|
|
|
|
// Delegate type for editor-only settings providers
|
|
|
|
|
|
public delegate float GetSettingsValueDelegate();
|
|
|
|
|
|
|
|
|
|
|
|
// Static delegates that will be set by editor code
|
|
|
|
|
|
private static GetSettingsValueDelegate getPlayerStopDistanceProvider;
|
|
|
|
|
|
private static GetSettingsValueDelegate getPlayerStopDistanceDirectInteractionProvider;
|
2025-10-02 05:42:17 +00:00
|
|
|
|
private static GetSettingsValueDelegate getPuzzlePromptRangeProvider;
|
2025-09-24 13:33:43 +00:00
|
|
|
|
|
|
|
|
|
|
// Editor-only method to set up providers - will be called from editor code
|
|
|
|
|
|
public static void SetupEditorProviders(
|
|
|
|
|
|
GetSettingsValueDelegate playerStopDistanceProvider,
|
2025-10-02 05:42:17 +00:00
|
|
|
|
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider,
|
|
|
|
|
|
GetSettingsValueDelegate puzzlePromptRangeProvider)
|
2025-09-24 13:33:43 +00:00
|
|
|
|
{
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
if (!Application.isPlaying)
|
|
|
|
|
|
{
|
|
|
|
|
|
getPlayerStopDistanceProvider = playerStopDistanceProvider;
|
|
|
|
|
|
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
2025-10-02 05:42:17 +00:00
|
|
|
|
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
|
2025-09-24 13:33:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static float GetPlayerStopDistance()
|
|
|
|
|
|
{
|
|
|
|
|
|
#if UNITY_EDITOR
|
2025-10-28 14:31:17 +01:00
|
|
|
|
if (getPlayerStopDistanceProvider == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0.0f;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-24 13:33:43 +00:00
|
|
|
|
if (!Application.isPlaying && getPlayerStopDistanceProvider != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return getPlayerStopDistanceProvider();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
return GameManager.Instance.PlayerStopDistance;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static float GetPlayerStopDistanceDirectInteraction()
|
|
|
|
|
|
{
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
if (!Application.isPlaying && getPlayerStopDistanceDirectInteractionProvider != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return getPlayerStopDistanceDirectInteractionProvider();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
return GameManager.Instance.PlayerStopDistanceDirectInteraction;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-02 05:42:17 +00:00
|
|
|
|
public static float GetPuzzlePromptRange()
|
|
|
|
|
|
{
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
|
if (!Application.isPlaying && getPuzzlePromptRangeProvider != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return getPuzzlePromptRangeProvider();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
return GameManager.Instance.DefaultPuzzlePromptRange;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-24 13:33:43 +00:00
|
|
|
|
// Add more methods as needed for other settings
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|