Fix bug with not using slot material

This commit is contained in:
Chandler Cox
2023-07-15 10:10:37 -05:00
parent ba93e1e1d0
commit c8edaf5d6e

View File

@@ -50,7 +50,7 @@ namespace FlaxEditor.CustomEditors.Editors
staticModel.SetMaterial(entryIndex, GPUDevice.Instance.DefaultMaterial);
materialEditor.Picker.SelectedAsset = GPUDevice.Instance.DefaultMaterial;
}
else if (material == staticModel.Model.MaterialSlots[entryIndex])
else if (material == staticModel.Model.MaterialSlots[entryIndex].Material)
{
staticModel.SetMaterial(entryIndex, null);
}
@@ -84,7 +84,7 @@ namespace FlaxEditor.CustomEditors.Editors
animatedModel.SetMaterial(entryIndex, GPUDevice.Instance.DefaultMaterial);
materialEditor.Picker.SelectedAsset = GPUDevice.Instance.DefaultMaterial;
}
else if (material == animatedModel.SkinnedModel.MaterialSlots[entryIndex])
else if (material == animatedModel.SkinnedModel.MaterialSlots[entryIndex].Material)
{
animatedModel.SetMaterial(entryIndex, null);
}
@@ -112,6 +112,7 @@ namespace FlaxEditor.CustomEditors.Editors
/// <inheritdoc />
public override void Refresh()
{
Debug.Log("Hit");
if (_updateName &&
_group != null &&
ParentEditor?.ParentEditor != null &&