예제 #1
0
        /// <summary>
        /// PrefabをビルドしてSTYLY Assetを作る
        /// </summary>
        /// <param name="prefab"></param>
        public bool BuildSTYLYAsset(GameObject prefab, BuildTarget buildTarget, string guid = null)
        {
            var abUtility = new AssetBundleUtility();

            if (guid == null)
            {
                guid = abUtility.GenerateGUID();
            }

            string outputPath = Path.Combine(OutputPath + "STYLY_ASSET", abUtility.GetPlatformName(buildTarget));

            var buildResult = abUtility.Build(guid, AssetDatabase.GetAssetPath(prefab), outputPath, buildTarget);

            return(buildResult != null);
        }
예제 #2
0
        /// <summary>
        /// AssetBundleのビルドを実行する
        /// </summary>
        /// <param name="scenePath">シーンのパス</param>
        /// <param name="buildTarget">ビルドターゲット(プラットフォーム)</param>
        /// <param name="guid">アセットバンドルのGUID</param>
        /// <returns></returns>
        public bool BuildSTYLYSceneAsset(string scenePath, BuildTarget buildTarget, string guid = null)
        {
            Debug.Log("BuildSTYLYSceneAsset:guid:" + guid);
            var abUtility = new AssetBundleUtility();

            // プラットフォーム切換え
            abUtility.SwitchPlatformAndPlayerSettings(buildTarget);

            if (guid == null)
            {
                guid = abUtility.GenerateGUID();
            }

            string outputPath = Path.Combine(OutputPath + "STYLY_ASSET", abUtility.GetPlatformName(buildTarget));

            var buildResult = abUtility.Build(guid, scenePath, outputPath, buildTarget);

            return(buildResult != null);
        }