Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Changing ScriptableObjects in Batch Mode

Discussion in 'Editor & General Support' started by CMC-Kiesel_Markus, May 9, 2019.

  1. CMC-Kiesel_Markus

    CMC-Kiesel_Markus

    Joined:
    Oct 31, 2016
    Posts:
    9
    Hey Guys,

    I'm trying to build several versions of our application in batch mode.
    To control the differences between the Versions we use ScriptableObjects.
    Now here come the thing, when I run:

    Unity.exe -projectPath path -executeMethod mybuildmethod -quit

    everything is just working fine, the ScriptableObjects are overwritten and included correctly into the build.
    But when I run this

    Unity.exe -projectPath path -batchmode -executeMethod mybuildmethod -quit

    The ScriptableObjects are not overwritten and the original ones are included.

    Does someone have any hint, how I could fix this behavior?

    Thanks!

    P.s. I'm using Unity 2018.2.21.f1
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You did not specify how these ScriptableObjects are overwritten? what happens inside the mybuildmethod code?
     
  3. CMC-Kiesel_Markus

    CMC-Kiesel_Markus

    Joined:
    Oct 31, 2016
    Posts:
    9
    Thank you for the response.
    As I was not able to overcome this limitation, I moved to a AssetBundle based workflow in order to generate different versions of the ScriptableObject.
     
  4. rtkommineni

    rtkommineni

    Joined:
    Jan 23, 2023
    Posts:
    1
    @CMC-Kiesel_Markus Hi - can you provide a brief summary of how you solved this using Assetbundle based workflow?
     
  5. CMC-Kiesel_Markus

    CMC-Kiesel_Markus

    Joined:
    Oct 31, 2016
    Posts:
    9
    What we did was to make different Asset Bundles which included different copies of the same ScriptableObject and by a custom build process we copied the correct AssetBundle into the output folder. But this will only work if your are acessing the ScriptableObjects mostly via script, as it will break any scene or prefab references.