This commit is contained in:
2026-06-04 10:42:23 +07:00
parent e7e90790c9
commit 9be2242378
4166 changed files with 53005 additions and 11401 deletions

View File

@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace Invector.Utils
{
[CustomPropertyDrawer(typeof(vSelectableStringAttribute))]
public class vSelectableStringDrawer : DecoratorDrawer
{
GUIStyle _selectableAreaStyle;
public GUIStyle SelectableAreaStyle
{
get
{
if(_selectableAreaStyle==null)
{
_selectableAreaStyle = new GUIStyle(EditorStyles.textArea);
}
return _selectableAreaStyle;
}
}
vSelectableStringAttribute selectableString
{
get { return ((vSelectableStringAttribute)attribute); }
}
public override float GetHeight()
{
float height = SelectableAreaStyle.CalcSize(new GUIContent(selectableString.selectableText)).y;
return height + EditorGUIUtility.singleLineHeight+8;
}
public override void OnGUI(Rect position)
{
var rect = position;
rect.height = EditorGUIUtility.singleLineHeight;
GUI.Label(rect, selectableString.tittle);
var textArea = rect;
textArea.y += rect.height+5;
textArea.height = (position.height - rect.height)-10;
GUI.TextArea(textArea, selectableString.selectableText);
}
}
}