First Commit

This commit is contained in:
2025-05-18 22:39:39 +03:00
commit 042ede7228
440 changed files with 103153 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace Golems.Attributes
{
[CustomPropertyDrawer(typeof(NavMeshMaskAttribute))]
public class NavMeshMaskDrawer : PropertyDrawer
{
// Draw the property inside the given rect
public override void OnGUI(Rect position, SerializedProperty serializedProperty, GUIContent label)
{
EditorGUI.BeginChangeCheck();
string[] navMeshAreaNames = GameObjectUtility.GetNavMeshAreaNames();
int navMeshArea = serializedProperty.intValue;
int selectedIndex = -1;
for (int i = 0; i < navMeshAreaNames.Length; i++)
{
if (GameObjectUtility.GetNavMeshAreaFromName(navMeshAreaNames[i]) == navMeshArea)
{
selectedIndex = i;
break;
}
}
int num = EditorGUI.Popup(position, "Navigation Area", selectedIndex, navMeshAreaNames);
if (EditorGUI.EndChangeCheck())
{
int navMeshAreaFromName = GameObjectUtility.GetNavMeshAreaFromName(navMeshAreaNames[num]);
serializedProperty.intValue = navMeshAreaFromName;
}
}
}
}