ProjectSettingsProvider.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. namespace LLM.Editor.Analysis
  3. {
  4. /// <summary>
  5. /// Provides access to Unity's project-wide settings assets.
  6. /// Note: This is a basic implementation. A full version would require
  7. /// specific logic for each settings type (Physics, Time, etc.).
  8. /// </summary>
  9. public class ProjectSettingsProvider : IContextProvider
  10. {
  11. public object GetContext(Object target, string qualifier)
  12. {
  13. if (string.IsNullOrEmpty(qualifier))
  14. {
  15. return "Error: A settings type (qualifier) is required (e.g., 'Physics', 'Time').";
  16. }
  17. // A real implementation would have a switch statement or dictionary
  18. // to handle different settings types and serialize them appropriately.
  19. switch (qualifier.ToLower())
  20. {
  21. case "physics":
  22. return new
  23. {
  24. Physics.gravity, Physics.defaultSolverIterations
  25. // Add other relevant physics settings here
  26. };
  27. case "time":
  28. return new
  29. {
  30. Time.fixedDeltaTime,
  31. maximumAllowedTimestep = Time.maximumDeltaTime
  32. // Add other relevant time settings here
  33. };
  34. default:
  35. return $"Error: Project settings for '{qualifier}' are not supported yet.";
  36. }
  37. }
  38. }
  39. }