init
This commit is contained in:
commit
001bb14f16
951 changed files with 270074 additions and 0 deletions
49
Assets/NavMeshComponents/Editor/NavMeshModifierEditor.cs
Normal file
49
Assets/NavMeshComponents/Editor/NavMeshModifierEditor.cs
Normal file
|
@ -0,0 +1,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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue