Search Unity

Is it possible to export .unitypackage from the built application ?

Discussion in 'Editor & General Support' started by CyrilGhys, Apr 17, 2020.

  1. CyrilGhys

    CyrilGhys

    Joined:
    Nov 1, 2018
    Posts:
    29
    Hello everyone,

    So I have been doing a little VR Maker editor inside of Unity, which I want to build later on (so users won't have to install Unity to create some VR stuff - but will be able to export their work to continue it with more functionnalities in Unity. The goal of this app is to facilitate VR creation for non-dev people).
    However, when I want to build my application, I have this error :
    Assets\Scripts\Meta\ProjectManager.cs(157,110): error CS0103: 
    The name 'ExportPackageOptions' does not exist in the current context

    I know we can't use UnityEditor methods from a build, so is this possible to create our own method ? (Oh and same question for AssetDatabase.CreateAsset, PrefabUtility.SaveAsPrefabAsset)

    Thank you
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    UnityEditor.ExportPackageOptions, UnityEditor.AssetDatabase.CreateAsset, and UnityEditor.PrefabUtility.SaveAsPrefabAsset don't exist in builds. The assets themselves don't even exist in the same form as in your original project, so I believe you'd have to write the entire system from creating the assets themselves to exporting them to a unitypackage file yourself. (no small task)

    Just want to point out that building a VR maker with Unity so people can use yours instead of Unity may run you afoul of the Unity TOS, specifically Unity Software Additional Terms 2.6(d), where you agree not to use Unity to create a competing product or service, which this kind of sounds like. I am not a lawyer.

    https://unity3d.com/legal/terms-of-service/software
     
  3. CyrilGhys

    CyrilGhys

    Joined:
    Nov 1, 2018
    Posts:
    29
    Thank you for the answer. I am doing this as part of an internship, so I will tell my manager that releasing a built application might not be the best choice :D I think we will look for an Asset Store release, so everyone could use it through Unity Editor (removing the first problem at the same time).

    Thank you again Joe !
     
    Joe-Censored likes this.