示例#1
0
        public int CopyBuildedAssetBundleToSTYLY(GameObject[] gameObjects)
        {
            var abUtility       = new AssetBundleUtility();
            var pcvrUtility     = new PCVRUtility();
            var buildedPathData = abUtility.GetBuildedAssetData();
            var paltformName    = "Windows";

            foreach (var gameObject in gameObjects)
            {
                var    buildedInfo = GetBuildedData(gameObject);
                string srcPath     = Path.Combine(OutputPath + "STYLY_ASSET", paltformName);
                srcPath = CommonUtility.FixPathString(Path.Combine(srcPath, buildedInfo["guid"]));
                Debug.Log("assetBundlePath:" + srcPath);

                string destPath = CommonUtility.FixPathString(Path.Combine(pcvrUtility.GetSTYLYPersistentDataPath(), "STYLY_ASSET\\" + paltformName));
                destPath = CommonUtility.FixPathString(Path.Combine(destPath, buildedInfo["guid"]));
                Debug.Log("STYLYPath:" + destPath);
                var result = pcvrUtility.PushFile(srcPath, destPath);

                if (result != 0)
                {
                    return(-1);
                }
            }

            return(0);
        }
示例#2
0
        string GetBuildedGUID(string prefabPath)
        {
            var    abUtility        = new AssetBundleUtility();
            var    buildedAssetData = abUtility.GetBuildedAssetData();
            var    buildedData      = buildedAssetData.GetData(prefabPath);
            string guid             = null;

            buildedData.TryGetValue(BuildedAssetPathData.GUID_KEY, out guid);
            return(guid);
        }
示例#3
0
        string GetBuildedGUID(GameObject gameObject)
        {
            var    prefabPath       = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(gameObject));
            var    abUtility        = new AssetBundleUtility();
            var    buildedAssetData = abUtility.GetBuildedAssetData();
            var    buildedData      = buildedAssetData.GetData(prefabPath);
            string guid             = null;

            buildedData.TryGetValue(BuildedAssetPathData.GUID_KEY, out guid);
            return(guid);
        }
示例#4
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        /// <param name="platformUtils">pcUtilsとandroidUtilsを結合したリスト</param>
        /// <param name="targetScene">ビルド対象シーン</param>
        public LocalPreviewToolBuilder(IEnumerable <IPlatformUtility> platformUtils, string targetScene)
        {
            // Setup
            stylyPluginUtility = new STYLYPluginUtility();

            // abUtilityを新規作成する
            abUtility = new AssetBundleUtility();

            // DI
            this.platformUtils = platformUtils;
            this.targetScene   = targetScene;
        }
示例#5
0
        Dictionary <string, string> GetBuildedData(GameObject gameObject)
        {
            var prefabPath  = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(gameObject));
            var abUtility   = new AssetBundleUtility();
            var buildedData = abUtility.GetBuildedAssetData();
            var index       = buildedData.prefabPathList.IndexOf(prefabPath);

            Dictionary <string, string> result = new Dictionary <string, string>();

            result.Add("prefab path", buildedData.prefabPathList[index]);
            result.Add("guid", buildedData.guidList[index]);

            return(result);
        }
示例#6
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);
        }
示例#7
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);
        }
示例#8
0
 /// <summary>
 /// インスタンス破棄時の処理
 /// </summary>
 private void Dispose()
 {
     // ユーティリティー系のフィールドをすべて破棄する。
     stylyPluginUtility = null;
     abUtility          = null;
 }