TowerDefenseGame/Assets/Plugins/NavMeshPlus/NavMeshComponents/Editor/NavMeshAgentAttributePropertyDrawer.cs
Nico 0ef60e5828 Add third party plugin NavMeshPlus
Add A* pathing to enemies
Add choice between havving Goblers chase player as priority or go to crystal
2025-07-09 19:14:28 -07:00

22 lines
870 B
C#

using NavMeshPlus.Components.Editors;
using UnityEditor;
using UnityEngine;
//***********************************************************************************
// Contributed by author jl-randazzo github.com/jl-randazzo
//***********************************************************************************
namespace NavMeshPlus.Extensions.Editors
{
[CustomPropertyDrawer(typeof(NavMeshAgentAttribute))]
public class NavMeshAgentAttributePropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
NavMeshComponentsGUIUtility.AgentTypePopup(position, label.text, property);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => NavMeshComponentsGUIUtility.IsAgentSelectionValid(property) ? 20 : 40;
}
}