public override void OnInspectorGUI()
        {
            base.DrawDefaultInspector();

            if (GUILayout.Button("Build", EditorStyles.miniButton))
            {
                DicingTexturePacker.Pack(this.serializedObject.targetObject as DicingTextures, false);
                AssetDatabase.Refresh();
            }
            if (GUILayout.Button("Rebuild", EditorStyles.miniButton))
            {
                DicingTexturePacker.Pack(this.serializedObject.targetObject as DicingTextures, true);
                AssetDatabase.Refresh();
            }
        }
Exemple #2
0
            void Build(MainAssetInfo textureDir, MainAssetInfo output1, MainAssetInfo output2, bool isRebuild)
            {
                //スクリプタブルオブジェクトの取得(なければ作成)
                string         name        = textureDir.Asset.name;
                DicingTextures dicingAsset = UtageEditorToolKit.GetImportedAssetCreateIfMissing <DicingTextures>(FilePathUtil.Combine(output1.AssetPath, name + ".asset"));
                Object         outPutDir   = UtageEditorToolKit.GetFolderAssetCreateIfMissing(output2.AssetPath, name);

                //情報を設定
                dicingAsset.InputDir  = textureDir.Asset;
                dicingAsset.OutputDir = outPutDir;
                if (dicingAsset.InputDir == null || dicingAsset.OutputDir == null)
                {
                    Debug.LogError("Folder is not found");
                    return;
                }
                //パッキング処理
                DicingTexturePacker.Pack(dicingAsset, isRebuild);
            }