73 lines
2.7 KiB
C#
73 lines
2.7 KiB
C#
using AlicizaX.Editor;
|
|
using AlicizaX.Scene.Runtime;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace AlicizaX.Scene.Editor
|
|
{
|
|
[CustomEditor(typeof(SceneComponent))]
|
|
internal sealed class SceneComponentInspector : ComponentTypeComponentInspector
|
|
{
|
|
private SerializedProperty m_EnableLoadSceneUpdateEvent = null;
|
|
private SerializedProperty m_EnableLoadSceneDependencyAssetEvent = null;
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
|
|
serializedObject.Update();
|
|
|
|
SceneComponent t = (SceneComponent)target;
|
|
|
|
// EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
|
// {
|
|
// EditorGUILayout.PropertyField(m_EnableLoadSceneUpdateEvent);
|
|
// EditorGUILayout.PropertyField(m_EnableLoadSceneDependencyAssetEvent);
|
|
// }
|
|
// EditorGUI.EndDisabledGroup();
|
|
//
|
|
// serializedObject.ApplyModifiedProperties();
|
|
//
|
|
// if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
|
|
// {
|
|
// EditorGUILayout.LabelField("Loaded Scene Asset Names", GetSceneNameString(t.GetLoadedSceneAssetNames()));
|
|
// EditorGUILayout.LabelField("Loading Scene Asset Names", GetSceneNameString(t.GetLoadingSceneAssetNames()));
|
|
// EditorGUILayout.LabelField("Unloading Scene Asset Names", GetSceneNameString(t.GetUnloadingSceneAssetNames()));
|
|
// Repaint();
|
|
// }
|
|
}
|
|
|
|
protected override void Enable()
|
|
{
|
|
m_EnableLoadSceneUpdateEvent = serializedObject.FindProperty("m_EnableLoadSceneUpdateEvent");
|
|
m_EnableLoadSceneDependencyAssetEvent = serializedObject.FindProperty("m_EnableLoadSceneDependencyAssetEvent");
|
|
}
|
|
|
|
protected override void RefreshTypeNames()
|
|
{
|
|
RefreshComponentTypeNames(typeof(ISceneManager));
|
|
}
|
|
|
|
// private string GetSceneNameString(string[] sceneAssetNames)
|
|
// {
|
|
// if (sceneAssetNames == null || sceneAssetNames.Length <= 0)
|
|
// {
|
|
// return "<Empty>";
|
|
// }
|
|
//
|
|
// string sceneNameString = string.Empty;
|
|
// foreach (string sceneAssetName in sceneAssetNames)
|
|
// {
|
|
// if (!string.IsNullOrEmpty(sceneNameString))
|
|
// {
|
|
// sceneNameString += ", ";
|
|
// }
|
|
//
|
|
// sceneNameString += SceneComponent.GetSceneName(sceneAssetName);
|
|
// }
|
|
//
|
|
// return sceneNameString;
|
|
// }
|
|
}
|
|
}
|