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,39 @@
using System;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Golems.Attributes
{
[CustomPropertyDrawer(typeof(NavMeshMaskAttribute))]
public class NavMeshMaskDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty serializedProperty, GUIContent label)
{
float width = position.width;
position.width = EditorGUIUtility.labelWidth;
EditorGUI.PrefixLabel(position, label);
string[] areaNames = GameObjectUtility.GetNavMeshAreaNames();
int mask = serializedProperty.intValue;
position.x += EditorGUIUtility.labelWidth;
position.width = width - EditorGUIUtility.labelWidth;
EditorGUI.BeginChangeCheck();
mask = EditorGUI.MaskField(position, mask, areaNames);
if (EditorGUI.EndChangeCheck())
{
serializedProperty.intValue = mask;
}
}
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)]
public class NavMeshMaskAttribute : PropertyAttribute // if there are build issues move the NavMeshMaskAttribute class out of the unity editor folder
{
}
}
#endif