Search Unity

Rebuilding & reattaching scripts and shaders manually in assetbundles

Discussion in 'Scripting' started by metaverse, Oct 21, 2014.

  1. metaverse

    metaverse

    Joined:
    May 9, 2014
    Posts:
    9
    I have a project where there will be a continuous stream of contributors creating assetbundles for various versions of the project. After getting into some headaches with versioning and loading of scripts and shaders across mobile platforms from assetbundles, I think a simpler approach would be to simply handle scripts and shaders myself at runtime.

    I would like to create a shared pool of simple scripts and shaders, referred to primarily by name, that will be guaranteed to be available when the application is loaded. When creating prefabs for assetbundles the user selects the script they want to attach (either as normal, or through some kind of Editor script that shows all the ones in the pool), enters the variables/references, and when they hit export only that information is stored in the assetbundle - not the script or shader itself.

    Is this possible? What would be the best modular way to approach this? Make it so each script has a struct that contains all possible public variables, serialize them to json, and unpack and populate the same struct on the other end?