Merge branch 'fix-type-editor-in-collection' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-type-editor-in-collection
This commit is contained in:
@@ -104,7 +104,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
public event Action<TypePickerControl> TypePickerValueChanged;
|
public event Action<TypePickerControl> TypePickerValueChanged;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The custom callback for types validation. Cane be used to implement a rule for types to pick.
|
/// The custom callback for types validation. Can be used to implement a rule for types to pick.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Func<ScriptType, bool> CheckValid;
|
public Func<ScriptType, bool> CheckValid;
|
||||||
|
|
||||||
@@ -353,7 +353,13 @@ namespace FlaxEditor.CustomEditors.Editors
|
|||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(typeReference.CheckMethod))
|
if (!string.IsNullOrEmpty(typeReference.CheckMethod))
|
||||||
{
|
{
|
||||||
var parentType = ParentEditor.Values[0].GetType();
|
var parentEditor = ParentEditor;
|
||||||
|
// Find actual parent editor if parent editor is collection editor
|
||||||
|
while (parentEditor.GetType().IsAssignableTo(typeof(CollectionEditor)))
|
||||||
|
parentEditor = parentEditor.ParentEditor;
|
||||||
|
|
||||||
|
var parentType = parentEditor.Values[0].GetType();
|
||||||
|
|
||||||
var method = parentType.GetMethod(typeReference.CheckMethod, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
|
var method = parentType.GetMethod(typeReference.CheckMethod, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
|
||||||
if (method != null)
|
if (method != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user