Files
Hasebe/Library/PackageCache/com.gustavopsantos.reflex@7857b9937c99/Editor/ReflexMenuItems.cs
T
2026-09-21 12:15:57 +03:00

49 lines
1.7 KiB
C#

using System.IO;
using UnityEditor;
using UnityEngine;
using Reflex.Core;
using Reflex.Configuration;
using Reflex.Editor.DebuggingWindow;
using UnityEditor.SceneManagement;
namespace Reflex.Editor
{
internal static class ReflexMenuItems
{
[MenuItem("Window/Analysis/Reflex Debugger %e")]
private static void OpenReflexDebuggingWindow()
{
EditorWindow.GetWindow<ReflexDebuggerWindow>(false, "Reflex Debugger", true);
}
[MenuItem("Assets/Create/Reflex/Settings")]
private static void CreateReflexSettings()
{
var directory = UnityEditorUtility.GetSelectedPathInProjectWindow();
var desiredAssetPath = Path.Combine(directory, "ReflexSettings.asset");
UnityEditorUtility.CreateScriptableObject<ReflexSettings>(desiredAssetPath);
}
[MenuItem("Assets/Create/Reflex/RootScope")]
private static void CreateReflexRootScope()
{
var directory = UnityEditorUtility.GetSelectedPathInProjectWindow();
var desiredAssetPath = Path.Combine(directory, "RootScope.prefab");
void Edit(GameObject prefab)
{
prefab.AddComponent<ContainerScope>();
}
UnityEditorUtility.CreatePrefab(desiredAssetPath, Edit);
}
[MenuItem("GameObject/Reflex/SceneScope")]
private static void CreateReflexSceneScope()
{
var containerScope = new GameObject("SceneScope").AddComponent<ContainerScope>();
Selection.activeObject = containerScope.gameObject;
EditorSceneManager.MarkSceneDirty(containerScope.gameObject.scene);
}
}
}