示例#1
0
        //---------------------------------------
        // Movie.
        //---------------------------------------

        #if ENABLE_CRIWARE_SOFDEC
        private void DrawMovieAssetConfigGUI(CriAssetConfig instance)
        {
            if (EditorLayoutTools.Header("Movie", "CriAssetConfigInspector-Movie"))
            {
                using (new ContentsScope())
                {
                    var change = DrawAssetImportInfoGUI(instance.MovieImportInfo);

                    if (change)
                    {
                        UnityEditorUtility.RegisterUndo("CriAssetConfigInspector Undo", instance);
                    }
                }
            }

            GUILayout.Space(4f);
        }
示例#2
0
        /// <summary>
        /// ムービーアセットをCriの成果物置き場からUnityの管理下にインポート.
        /// </summary>
        private static void UpdateMovieAssets(CriAssetConfig config, string scriptPath, string internalResourcesFolderName, string externalResourcesFolderName)
        {
            var importPath = config.MovieImportInfo.ImportPath;
            var folderName = config.MovieImportInfo.FolderName;

            var assetExtensions = new string[] { CriAssetDefinition.UsmExtension };

            var assetDirInternal = PathUtility.Combine(new string[] { UnityPathUtility.AssetsFolder, internalResourcesFolderName, folderName });

            var updateScript = UpdateCriAssets(
                importPath, folderName,
                internalResourcesFolderName, externalResourcesFolderName,
                assetExtensions
                );

            if (updateScript)
            {
                MovieScriptGenerator.Generate(scriptPath, assetDirInternal);
            }
        }
示例#3
0
        /// <summary>
        /// サウンドアセットをCriの成果物置き場からUnityの管理下にインポート.
        /// </summary>
        private static void UpdateSoundAssets(CriAssetConfig config, string scriptPath, string streamingAssetFolderName, string externalResourcesFolderName)
        {
            var importPath = config.SoundImportInfo.ImportPath;
            var folderName = config.SoundImportInfo.FolderName;

            var assetExtensions = new string[] { CriAssetDefinition.AcbExtension, CriAssetDefinition.AwbExtension };

            var assetDirInternal = PathUtility.Combine(new string[] { UnityPathUtility.AssetsFolder, streamingAssetFolderName, folderName });

            UpdateAcfAsset(config.AcfAssetSourceFullPath, config.AcfAssetExportPath);

            var updateScript = UpdateCriAssets(
                importPath, folderName,
                streamingAssetFolderName, externalResourcesFolderName,
                assetExtensions
                );

            if (updateScript)
            {
                SoundScriptGenerator.Generate(scriptPath, assetDirInternal, folderName);
            }
        }
示例#4
0
        //---------------------------------------
        // Sound.
        //---------------------------------------

        #if ENABLE_CRIWARE_ADX
        private void DrawSoundAssetConfigGUI(CriAssetConfig instance)
        {
            var acfAssetSourcePathProperty = serializedObject.FindProperty("acfAssetSourceFullPath");
            var acfAssetExportPathProperty = serializedObject.FindProperty("acfAssetExportPath");

            if (EditorLayoutTools.Header("Sound", "CriAssetConfigInspector-Sound"))
            {
                using (new ContentsScope())
                {
                    var change = DrawAssetImportInfoGUI(instance.SoundImportInfo);

                    if (change)
                    {
                        UnityEditorUtility.RegisterUndo("CriAssetConfigInspector Undo", instance);
                    }

                    // Style.
                    var pathTextStyle = GUI.skin.GetStyle("TextArea");
                    pathTextStyle.alignment = TextAnchor.MiddleLeft;

                    GUILayout.Label("AcfAssetSourcePath");

                    using (new EditorGUILayout.HorizontalScope())
                    {
                        GUILayout.Label(acfAssetSourcePathProperty.stringValue, pathTextStyle);

                        if (GUILayout.Button("Edit", EditorStyles.miniButton, GUILayout.Width(50f)))
                        {
                            UnityEditorUtility.RegisterUndo("CriAssetConfigInspector Undo", instance);

                            var acfAssetSource = EditorUtility.OpenFilePanel("Select ACF", "", "");

                            var assetFolderUri = new Uri(Application.dataPath);
                            var targetUri      = new Uri(acfAssetSource);
                            acfAssetSourcePathProperty.stringValue = assetFolderUri.MakeRelativeUri(targetUri).ToString();

                            serializedObject.ApplyModifiedProperties();
                        }
                    }

                    GUILayout.Label("AcfAssetExportPath");

                    using (new EditorGUILayout.HorizontalScope())
                    {
                        GUILayout.Label(acfAssetExportPathProperty.stringValue, pathTextStyle);

                        if (GUILayout.Button("Edit", EditorStyles.miniButton, GUILayout.Width(50f)))
                        {
                            UnityEditorUtility.RegisterUndo("CriAssetConfigInspector Undo", instance);

                            var acfAssetDirectory = EditorUtility.OpenFolderPanel("Select CriSetting Folder", "", "");

                            var assetFolderUri = new Uri(Application.dataPath);
                            var targetUri      = new Uri(acfAssetDirectory);
                            acfAssetExportPathProperty.stringValue = assetFolderUri.MakeRelativeUri(targetUri).ToString();

                            serializedObject.ApplyModifiedProperties();
                        }
                    }
                }
            }

            GUILayout.Space(4f);
        }