Fix not using hardcoded order for showing Actor main properties in editor

This commit is contained in:
Wojtek Figat
2021-01-13 15:35:53 +01:00
parent af692605ab
commit b2a2652b56
5 changed files with 26 additions and 62 deletions

View File

@@ -24,43 +24,6 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
private Guid _linkedPrefabId;
/// <inheritdoc />
protected override void SpawnProperty(LayoutElementsContainer itemLayout, ValueContainer itemValues, ItemInfo item)
{
// Note: we cannot specify actor properties editor types directly because we want to keep editor classes in FlaxEditor assembly
int order = item.Order?.Order ?? int.MinValue;
switch (order)
{
// Override static flags editor
case -80:
item.CustomEditor = new CustomEditorAttribute(typeof(ActorStaticFlagsEditor));
break;
// Override layer editor
case -69:
item.CustomEditor = new CustomEditorAttribute(typeof(ActorLayerEditor));
break;
// Override tag editor
case -68:
item.CustomEditor = new CustomEditorAttribute(typeof(ActorTagEditor));
break;
// Override position/scale editor
case -30:
case -10:
item.CustomEditor = new CustomEditorAttribute(typeof(ActorTransformEditor.PositionScaleEditor));
break;
// Override orientation editor
case -20:
item.CustomEditor = new CustomEditorAttribute(typeof(ActorTransformEditor.OrientationEditor));
break;
}
base.SpawnProperty(itemLayout, itemValues, item);
}
/// <inheritdoc />
protected override List<ItemInfo> GetItemsForType(ScriptType type)
{