Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question Files with differing names and multiple Unity types

Discussion in '2022.2 Beta' started by vertxxyz, Nov 23, 2022.

  1. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    109
    It seems you can now create UnityEngine.Object subtypes in files that don't share the same name without that causing errors.
    Presumably this is intended, and linked to:
    Long time coming and should help reduce friction for beginners a ton!

    You can also have multiple unity types in the same file. Presumably the one that isn't matched is described as 'not templated' as per that patch note. That type can only be used via
    AddComponent
    , and won't appear in any menus, even with you add the
    AddComponentMenu
    attribute.
    Should that be considered a bug? I have zero familiarity with what's expected in this whole new world.

    I imagine it's not allowed as the Add Component UI has logic that makes assumptions about scripts being capable of having the editor-assigned references. But there's no good indicators that this is a restriction. I would instead expect that logic to be ignored, and the UI to function as normal.
     
    Last edited: Nov 23, 2022