1
Support / tk2dGrid in PropertyDrawer
« on: June 16, 2014, 07:26:17 pm »
why does the grid disappear after 1 second? thanks
TestGrid.cs
TestGrid.cs
Code: [Select]
[Serializable]
public struct TestGrid
{
public int Unused;
}
Editor/TestGridEditor.csCode: [Select]
[CustomPropertyDrawer(typeof(DataGrid))]
public class TestGridEditor : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
tk2dGrid.Draw(position);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return EditorGUIUtility.singleLineHeight;
}
}