puzzlestep_indicators (#14)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Reviewed-on: #14
This commit is contained in:
@@ -187,6 +187,11 @@ public class GameManager : MonoBehaviour
|
||||
public LayerMask InteractableLayerMask => GetSettings<IInteractionSettings>()?.InteractableLayerMask ?? -1;
|
||||
public GameObject BasePickupPrefab => GetSettings<IInteractionSettings>()?.BasePickupPrefab;
|
||||
public GameObject LevelSwitchMenuPrefab => GetSettings<IInteractionSettings>()?.LevelSwitchMenuPrefab;
|
||||
|
||||
// PUZZLE SETTINGS
|
||||
|
||||
public float DefaultPuzzlePromptRange => GetSettings<IInteractionSettings>()?.DefaultPuzzlePromptRange ?? 3.0f;
|
||||
public GameObject DefaultPuzzleIndicatorPrefab => GetSettings<IInteractionSettings>()?.DefaultPuzzleIndicatorPrefab;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the combination rule for two items, if any.
|
||||
|
||||
@@ -22,6 +22,12 @@ namespace AppleHills.Core.Settings
|
||||
[SerializeField] private GameObject basePickupPrefab;
|
||||
[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")]
|
||||
[SerializeField] private List<CombinationRule> combinationRules = new List<CombinationRule>();
|
||||
[SerializeField] private List<SlotItemConfig> slotItemConfigs = new List<SlotItemConfig>();
|
||||
@@ -35,6 +41,8 @@ namespace AppleHills.Core.Settings
|
||||
public GameObject LevelSwitchMenuPrefab => levelSwitchMenuPrefab;
|
||||
public List<CombinationRule> CombinationRules => combinationRules;
|
||||
public List<SlotItemConfig> SlotItemConfigs => slotItemConfigs;
|
||||
public GameObject DefaultPuzzleIndicatorPrefab => defaultPuzzleIndicatorPrefab;
|
||||
public float DefaultPuzzlePromptRange => defaultPuzzlePromptRange;
|
||||
|
||||
public override void OnValidate()
|
||||
{
|
||||
@@ -43,6 +51,7 @@ namespace AppleHills.Core.Settings
|
||||
playerStopDistance = Mathf.Max(0.1f, playerStopDistance);
|
||||
playerStopDistanceDirectInteraction = Mathf.Max(0.1f, playerStopDistanceDirectInteraction);
|
||||
followerPickupDelay = Mathf.Max(0f, followerPickupDelay);
|
||||
defaultPuzzlePromptRange = Mathf.Max(0.1f, defaultPuzzlePromptRange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,10 @@ namespace AppleHills.Core.Settings
|
||||
GameObject LevelSwitchMenuPrefab { get; }
|
||||
List<CombinationRule> CombinationRules { get; }
|
||||
List<SlotItemConfig> SlotItemConfigs { get; }
|
||||
|
||||
// Puzzle settings
|
||||
GameObject DefaultPuzzleIndicatorPrefab { get; }
|
||||
float DefaultPuzzlePromptRange { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,17 +13,20 @@ namespace AppleHills
|
||||
// Static delegates that will be set by editor code
|
||||
private static GetSettingsValueDelegate getPlayerStopDistanceProvider;
|
||||
private static GetSettingsValueDelegate getPlayerStopDistanceDirectInteractionProvider;
|
||||
private static GetSettingsValueDelegate getPuzzlePromptRangeProvider;
|
||||
|
||||
// Editor-only method to set up providers - will be called from editor code
|
||||
public static void SetupEditorProviders(
|
||||
GetSettingsValueDelegate playerStopDistanceProvider,
|
||||
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider)
|
||||
GetSettingsValueDelegate playerStopDistanceDirectInteractionProvider,
|
||||
GetSettingsValueDelegate puzzlePromptRangeProvider)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
getPlayerStopDistanceProvider = playerStopDistanceProvider;
|
||||
getPlayerStopDistanceDirectInteractionProvider = playerStopDistanceDirectInteractionProvider;
|
||||
getPuzzlePromptRangeProvider = puzzlePromptRangeProvider;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -52,6 +55,18 @@ namespace AppleHills
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user