using UnityEngine;
using UnityEngine.Polybrush;
namespace UnityEditor.Polybrush
{
///
/// The default editor for SplatWeight.
///
[CustomEditor(typeof(SplatWeight))]
internal class SplatWeightEditor : Editor
{
static int thumbSize = 64;
///
/// Editor for blend. Returns true if blend has been modified.
///
///
///
///
///
internal static int OnInspectorGUI(int index, ref SplatWeight blend, AttributeLayout[] attribs)
{
// if(blend == null && attribs != null)
// blend = new SplatWeight( SplatWeight.GetChannelMap(attribs) );
// bool mismatchedOrNullAttributes = blend == null || !blend.MatchesAttributes(attribs);
Rect r = GUILayoutUtility.GetLastRect();
int yPos = (int) Mathf.Ceil(r.y + r.height);
index = PolyGUILayout.ChannelField(index, attribs, thumbSize, yPos);
return index;
}
}
}