Skip to content

Selecting the parent object #3

Description

@GieziJo

The selected parent should be of the exact same class as the overriden item (otherwise fields might be missing) and should not be the child itself.
This check is currently done when setting the parent as:

if (parent.GetType() != target.GetType())
{
   Debug.Log("Only equal types can be selected as parent");
   return;
}

if (AssetDatabase.GetAssetPath(parent) == AssetDatabase.GetAssetPath(target))
{
   Debug.Log("You can't select the same object as parent");
   return;
}

It would be alot better to directly filter the possible candidates when selecting in the object, but adding the AssetSelector attribute with a filter, or building a custom ValueDropdown both did not work, not sure why.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions