zombie_mp/Assets/HQ FPS Weapons/Scripts/Inventory/Editor/ItemDescriptionDrawer.cs
Sewmina Dilshan 68183e5317 initial
2021-08-23 13:28:33 +05:30

20 lines
594 B
C#

using UnityEngine;
using UnityEditor;
namespace HQFPSWeapons
{
[CustomPropertyDrawer(typeof(ItemDescription))]
public class ItemDescriptionDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
position.x -= 16f;
EditorGUI.PropertyField(position, property.FindPropertyRelative("Description"), GUIContent.none);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return EditorGUI.GetPropertyHeight(property.FindPropertyRelative("Description"), label, true);
}
}
}