Jump to content

ScriptableObjectDrawer.cs draws all scriptable objects of the project (not just Gena)


Go to solution Solved by Bryan,

Recommended Posts

Posted

ScriptableObjectDrawer.cs draws all scriptable objects in the project, not just Gena. That's really cumbersome because I don't want other scriptable objects to be drawn that way. Also, it messes with the popular OdinInspector package which I use (see image below).

 

My solution was to skip it by writing another property drawer with this code below, but it's pretty annoying because I have to add all new scriptable objects I make this way.

[DrawerPriority(0f, 0f, 0.5f)]
public class SkipScriptableObjectDrawerFromOtherAsset : OdinValueDrawer<ThingType>
{
    protected override void Initialize()
    {
        this.SkipWhenDrawing = true;

        var drawerFromOtherAsset = Property.GetActiveDrawerChain().BakedChain
            .FirstOrDefault(drawer => drawer is AbstractTypeUnityPropertyDrawer<ScriptableObjectDrawer, ScriptableObject, ThingType>);

        if (drawerFromOtherAsset == null) return;

        drawerFromOtherAsset.SkipWhenDrawing = true;
    }
}

 

Is there a solution so that it only draws scriptable objects from Gena?

 

unknown.png

Posted

1 week without a comment? It's really sloppy for such an expensive asset to include a drawer that draws ALL scriptable objects in a project, instead of only those in the asset.

  • Solution
Posted

Hey Nicknev sorry for the delay in response. 
After reviewing this script you can actually remove it as its not necessary. 
We will be removing this in the next update. 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...