Simplify object initialization

This commit is contained in:
Paul Pacheco 2019-02-22 18:47:45 -06:00
parent d2eac37aa9
commit efac99813c

View File

@ -27,15 +27,16 @@ protected void Init()
spawnListProperty = serializedObject.FindProperty("spawnPrefabs");
spawnList = new ReorderableList(serializedObject, spawnListProperty);
spawnList.drawHeaderCallback = DrawHeader;
spawnList.drawElementCallback = DrawChild;
spawnList.onReorderCallback = Changed;
spawnList.onRemoveCallback = RemoveButton;
spawnList.onChangedCallback = Changed;
spawnList.onReorderCallback = Changed;
spawnList.onAddCallback = AddButton;
spawnList.elementHeight = 16; // this uses a 16x16 icon. other sizes make it stretch.
spawnList = new ReorderableList(serializedObject, spawnListProperty)
{
drawHeaderCallback = DrawHeader,
drawElementCallback = DrawChild,
onReorderCallback = Changed,
onRemoveCallback = RemoveButton,
onChangedCallback = Changed,
onAddCallback = AddButton,
elementHeight = 16 // this uses a 16x16 icon. other sizes make it stretch.
};
}
}