This repository has been archived on 2025-09-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
XericLibrary-OLD/Editor/CustomDrawer/ReName.cs

34 lines
640 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using XericLibrary.Runtime.CustomDrawer;
namespace XericLibrary.Editor.CustomDrawer
{
[CustomPropertyDrawer(typeof(ReNameAttribute))]
public class ReNameDrawer : PropertyDrawer
{
private GUIContent lable = null;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if(lable == null)
{
string name = (attribute as ReNameAttribute).Name;
lable = new GUIContent(name);
}
EditorGUI.PropertyField(position, property, lable);
}
}
}
#endif