My goal was to split our project into two. One project would contain game code. The other project would contain assets for download (in the thousands). This was working until I tried to load a bundle containing a scriptableObject.
I have an Identical ScriptableObject class in both projects:
public class LevelObject : ScriptableObject{
public Texture bg;
public TextAsset levelData;
public GameObject mesh;
}
I wanted to bundle this scriptable object so that I could easily load everything out of the bundle. So I create a .asset file:
LevelObject asset = ScriptableObject.CreateInstance();
AssetDatabase.CreateAsset(asset,fullName);
AssetDatabase.SaveAssets();
When I bundle this, it looks to be the right size. But when I try to load the asset out of the bundle, it is always null.
Is this because I have duplicated the LevelObject script in both projects? I know that new code cannot be in an assetbundle. If this were a component on a prefab, instead of a scriptableObject, would it work? With our split projects, does that mean no components ever? Or am I just doing something wrong. This process has worked fine so far for textures/meshes/prefabs, but this is the first non-unity class.
Should we just not divide the project? I worry about having thousands of large textures on all dev machines. I would prefect a build machine to have the assets.
Thank you for reading,
Dave