123456789101112131415161718192021222324252627282930313233 |
- using UnityEngine;
- using UnityEngine.SceneManagement;
- using UnityEditor.SceneManagement;
- namespace LLM.Editor.Analysis
- {
- /// <summary>
- /// Provides context about the currently active scene in the editor.
- /// </summary>
- public class ActiveSceneProvider : IContextProvider
- {
- public class SceneInfo
- {
- public string name;
- public string path;
- public bool isDirty;
- public bool isValid;
- }
- public object GetContext(Object target, string qualifier)
- {
- var activeScene = SceneManager.GetActiveScene();
- return new SceneInfo
- {
- name = activeScene.name,
- path = activeScene.path,
- isDirty = activeScene.isDirty,
- isValid = activeScene.IsValid()
- };
- }
- }
- }
|