Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

ScriptableObject question.

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

  1. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    244
    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,874
    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,399
    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,081
    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:
    244
    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.