Refactor the settings to remove the old class

This commit is contained in:
Michal Pikulski
2025-09-24 08:05:37 +02:00
committed by AlexanderT
parent 404f6f4e5c
commit f07ce88331
19 changed files with 239 additions and 443 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);