blob: a2c636ca5d39e551b7cd187d0cbdd589ea2159c9 (
plain)
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
|
using UnityEngine.AI;
namespace UnityEditor.AI
{
[CanEditMultipleObjects]
[CustomEditor(typeof(NavMeshModifier))]
class NavMeshModifierEditor : Editor
{
SerializedProperty m_AffectedAgents;
SerializedProperty m_Area;
SerializedProperty m_IgnoreFromBuild;
SerializedProperty m_OverrideArea;
void OnEnable()
{
m_AffectedAgents = serializedObject.FindProperty("m_AffectedAgents");
m_Area = serializedObject.FindProperty("m_Area");
m_IgnoreFromBuild = serializedObject.FindProperty("m_IgnoreFromBuild");
m_OverrideArea = serializedObject.FindProperty("m_OverrideArea");
NavMeshVisualizationSettings.showNavigation++;
}
void OnDisable()
{
NavMeshVisualizationSettings.showNavigation--;
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(m_IgnoreFromBuild);
EditorGUILayout.PropertyField(m_OverrideArea);
if (m_OverrideArea.boolValue)
{
EditorGUI.indentLevel++;
NavMeshComponentsGUIUtility.AreaPopup("Area Type", m_Area);
EditorGUI.indentLevel--;
}
NavMeshComponentsGUIUtility.AgentMaskPopup("Affected Agents", m_AffectedAgents);
EditorGUILayout.Space();
serializedObject.ApplyModifiedProperties();
}
}
}
|