我正在统一创建 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);
}
}