rabidus-test/Assets/Amazing Assets/Advanced Dissolve/Editor/Property Drawers/AdvancedDissolveUVScrollDra...

33 lines
963 B
C#
Raw Normal View History

2023-09-18 20:09:22 +03:00
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace AmazingAssets.AdvancedDissolveEditor
{
class AdvancedDissolveUVScrollDrawer : MaterialPropertyDrawer
{
static GUIContent text = new GUIContent("Scroll");
public override void OnGUI(Rect position, MaterialProperty prop, string label, UnityEditor.MaterialEditor editor)
{
position.y -= 2;
float width = UnityEditor.EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
EditorGUI.PrefixLabel(new Rect(position.x, position.y, width, 16f), text);
Vector2 vector = prop.vectorValue;
EditorGUI.BeginChangeCheck();
vector = EditorGUI.Vector2Field(new Rect(position.x + width, position.y, position.width - width, 16f), GUIContent.none, vector);
if (EditorGUI.EndChangeCheck())
{
prop.vectorValue = vector;
}
}
}
}