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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ScriptableObject question.

Discussion in 'Experimental Scripting Previews' started by Seto, May 23, 2018.

  1. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    Is it possible to use ScriptableObject with DLL or source code?
    For now the ScriptableObject is mapped by fileId and guid.

    It's easy to debug with source code in the project. But it's better to distribute DLL when it is published as a plugin or asset.

    Is there a way to remap them?
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,967
    I dont understand what you mean..

    What are:

    "It's easy to debug with source code in the project."

    "For now the ScriptableObject is mapped by fileId and guid."

    meant to mean? :S
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There's zero difference between scripts and DLLs as far as functionality goes. They are exactly the same thing...you don't think Unity is actually running text scripts, I hope; it's running compiled code which is identical to code in DLLs. It's not "better to distribute DLL when it is published as a plugin or asset", by the way. Many people won't buy unless you include source code. I do include DLLs for most of my utilities (one of which uses a ScriptableObject) for the sake of eliminating code compiling time, but also include source.

    --Eric
     
  4. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,106
    As I know best you can do is AssemblyDefinition.
    You will distribute sources but Unity compile it into separate dll once on customer project.
     
  5. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    243
    If you read the ScriptableObject asset, you will see the ScriptableObjects are mapped by guid and fileID together.

    But I actually have a need to not include the source code.
    Any way I can write a tool to map the ScriptableObjects myself. But it's inconvenience. I thought the ScriptData update will add this feature.