I want to prefabricate a model (mesh, material, texture) made from a script on Android or iOS

Error message

AssetDatabase.CreateAsset can only be used within a project
What should I do for Android and iOS
I want to avoid writing to StreamingAsset
(Maybe AssetDatabase.CreateAsset only works in the editor?)

Supplemental information (language/FW/tool version etc.)


  • Answer # 1


    Maybe AssetDatabase.CreateAsset only works in the editor?

    That's right.
    If you search in the official reference and "class In UnityEditor" is written under the class name, it is a class that can only be used in the editor.

    If you want to make a prefab, you have to save each parameter in some way and make it pseudo with Instantiate and AddComponent.