Question by
dshinigami · Jul 14, 2016 at 08:49 AM ·
assetsscriptable objectstreamingassets
Why it is impossible to create an asset in "StreamingAsset" folder?
I'm trying to create an asset of a ScriptableObject in the StreamingAssets folder, but the result is a "blank", not editable, asset file. anything other path works fine, but in that folder it not works. I use this code:
[MenuItem("Test/Make Some Data")]
private static void CreateAsset()
{
MyScriptableObject phrasesList = CreateInstance<MyScriptableObject>();
AssetDatabase.CreateAsset(phrasesList, "Assets/StreamingAssets/MyAsset.asset");
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
and not work. this, instead:
[MenuItem("Test/Make Some Data")]
private static void CreateAsset()
{
MyScriptableObject phrasesList = CreateInstance<MyScriptableObject>();
AssetDatabase.CreateAsset(phrasesList, "Assets/foobarAssets/MyAsset.asset");
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
Works fine. There is a reason for this issue?
Comment
$$anonymous$$aybe this answer is useless: it is possible to use the function
AssetDatabase.LoadAssetAtPath<$$anonymous$$yScriptableObject>("Assets/Strea$$anonymous$$gAssets/$$anonymous$$yAsset.asset");
during runtime?
Your answer
Follow this Question
Related Questions
Remove unused assets 5 Answers
Editor.log vs build size 100+ sharedassets 0 Answers
How to generate assets along a vector3 0 Answers
Object doesn't show : loaded or not loaded ? 0 Answers
Change location of asset download?? 0 Answers