[Player][Interactions] Refactor common settings to be in the Game Settings SO. Update follow paramters and pathfinding for Pulver

This commit is contained in:
Michal Pikulski
2025-09-04 11:12:19 +02:00
parent 65d8be6cf2
commit 5d395ba4f4
8 changed files with 185 additions and 103 deletions

View File

@@ -6,6 +6,51 @@ public class GameSettings : ScriptableObject
[Header("Interactions")]
public float playerStopDistance = 6.0f;
public float followerPickupDelay = 0.2f;
// Add other settings here as needed
}
[Header("Follower Settings")]
public float followDistance = 1.5f;
public float manualMoveSmooth = 8f;
public float thresholdFar = 2.5f;
public float thresholdNear = 0.5f;
public float stopThreshold = 0.1f;
[Header("Player Settings")]
public float moveSpeed = 5f;
public float stopDistance = 0.1f;
public bool useRigidbody = true;
[Header("Backend Settings")]
[Tooltip("Technical parameters, not for design tuning")]
public float followUpdateInterval = 0.1f;
public float followerSpeedMultiplier = 1.2f;
public float heldIconDisplayHeight = 2.0f;
// Singleton pattern
private static GameSettings _instance;
public static GameSettings Instance {
get {
if (_instance == null) {
_instance = Resources.Load<GameSettings>("GameSettings");
if (_instance == null) {
Debug.LogError("GameSettings asset not found in Resources folder!");
}
}
return _instance;
}
}
// Static property wrappers for easy access
public static float PlayerStopDistance => Instance.playerStopDistance;
public static float FollowerPickupDelay => Instance.followerPickupDelay;
public static float FollowDistance => Instance.followDistance;
public static float ManualMoveSmooth => Instance.manualMoveSmooth;
public static float ThresholdFar => Instance.thresholdFar;
public static float ThresholdNear => Instance.thresholdNear;
public static float StopThreshold => Instance.stopThreshold;
public static float MoveSpeed => Instance.moveSpeed;
public static float StopDistance => Instance.stopDistance;
public static bool UseRigidbody => Instance.useRigidbody;
public static float FollowUpdateInterval => Instance.followUpdateInterval;
public static float FollowerSpeedMultiplier => Instance.followerSpeedMultiplier;
public static float HeldIconDisplayHeight => Instance.heldIconDisplayHeight;
}