Files
H3VR-TNH-Quality-of-Life-Im…/Assets/Alloy/Scripts/MaterialMapChannelPacker/Editor/ChannelDrawer.cs
T
2022-01-22 20:13:49 -08:00

24 lines
653 B
C#

// Alloy Physical Shader Framework
// Copyright 2013-2017 RUST LLC.
// http://www.alloy.rustltd.com/
using UnityEditor;
using UnityEngine;
namespace Alloy {
[CustomPropertyDrawer(typeof(EnumFlagsAttribute))]
public class ChannelDrawer : PropertyDrawer {
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
EditorGUI.BeginProperty(position, label, property);
EditorGUI.BeginChangeCheck();
int index = EditorGUI.MaskField(position, label, property.intValue, property.enumDisplayNames);
if (EditorGUI.EndChangeCheck()) {
property.intValue = index;
}
EditorGUI.EndProperty();
}
}
}