Revamp the settings system (#7)

- A Settings Provider system to utilize addressables for loading settings at runtime
- An editor UI for easy modifications of the settings objects
- A split out developer settings functionality to keep gameplay and nitty-gritty details separately
- Most settings migrated out of game objects and into the new system
- An additional Editor utility for fetching the settings at editor runtime, for gizmos, visualization etc

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: AlexanderT <alexander@foolhardyhorizons.com>
Reviewed-on: #7
This commit is contained in:
2025-09-24 13:33:43 +00:00
parent 4b206b9b2e
commit 63cb3f1a8c
77 changed files with 2795 additions and 978 deletions

View File

@@ -194,25 +194,9 @@ namespace Interactions
/// </summary>
void OnDrawGizmos()
{
float playerStopDistance;
if (Application.isPlaying)
{
playerStopDistance = characterToInteract == CharacterToInteract.Trafalgar
? GameManager.Instance.PlayerStopDistanceDirectInteraction
: GameManager.Instance.PlayerStopDistance;
}
else
{
// Load settings directly from asset path in editor
var settings =
UnityEditor.AssetDatabase.LoadAssetAtPath<GameSettings>(
"Assets/Data/Settings/DefaultSettings.asset");
playerStopDistance = settings != null
? (characterToInteract == CharacterToInteract.Trafalgar
? settings.playerStopDistanceDirectInteraction
: settings.playerStopDistance)
: 1.0f;
}
float playerStopDistance = characterToInteract == CharacterToInteract.Trafalgar
? AppleHills.SettingsAccess.GetPlayerStopDistanceDirectInteraction()
: AppleHills.SettingsAccess.GetPlayerStopDistance();
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(transform.position, playerStopDistance);