2017-10-14 81 views
0

我正在统一创建3D对象的资产捆绑。它不是用变换值(比例,旋转,位置)创建的。但是,虽然我调试它的值是正确的,但捆绑和加载到我的应用程序后重置为默认值。统一 - 资产捆绑无法正常创建

我使用下面的脚本导出3D对象,以资产包

using UnityEngine; 
 
using System.Collections; 
 
using UnityEditor; 
 

 
public class CreateAssetBundles : Editor 
 
{ 
 
    [MenuItem("Assets/Create Asset Bundle")] 
 
    static void CreateBundle() 
 
    { 
 
     string bundlePath = "Assets/AssetBundle/"; 
 
     Object[] selectedAssets = Selection.GetFiltered(typeof(Object), SelectionMode.Assets); 
 
     GameObject gameobject = (GameObject) selectedAssets[0]; 
 
     string name = gameobject.name; 
 
     BuildPipeline.BuildAssetBundle(Selection.activeObject, selectedAssets, bundlePath+name+ ".unity3d", BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.Android); 
 

 
    } 
 
}

回答