XRManagerEditor.cs
1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.XR.Management;
namespace UnityEditor.XR.Management
{
[CustomEditor(typeof(XRManagerSettings))]
internal class XRManagerSettingsEditor : Editor
{
XRLoaderOrderUI m_LoadOrderUI = null;
XRLoaderInfoManager m_LoaderInfoManager = new XRLoaderInfoManager();
internal BuildTargetGroup BuildTarget
{
get { return m_LoaderInfoManager.BuildTarget; }
set { m_LoaderInfoManager.BuildTarget = value; }
}
void OnEnable()
{
m_LoaderInfoManager.OnEnable();
if (m_LoadOrderUI == null)
{
m_LoadOrderUI = new XRLoaderOrderUI(m_LoaderInfoManager);
}
}
void OnDisable()
{
m_LoaderInfoManager.OnDisable();
}
void PopulateProperty(string propertyPath, ref SerializedProperty prop)
{
if (prop == null) prop = serializedObject.FindProperty(propertyPath);
}
public void Reload()
{
m_LoaderInfoManager.ShouldReload = true;
}
/// <summary><see href="https://docs.unity3d.com/ScriptReference/Editor.OnInspectorGUI.html">Editor Documentation</see></summary>
public override void OnInspectorGUI()
{
if (serializedObject == null || serializedObject.targetObject == null)
return;
serializedObject.Update();
m_LoaderInfoManager.SerializedObjectData = serializedObject;
if (m_LoaderInfoManager.ShouldReload)
m_LoaderInfoManager.ReloadData();
m_LoadOrderUI.OnGUI();
serializedObject.ApplyModifiedProperties();
}
}
}