2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UnityでProjectSettingsと共にunitypackageをExportする

Posted at

雑記

レイヤー設定と共にパッケージを作成したい機会があったので。
問題ないかは不明。

http://myoujing.wpblog.jp/2014/03/274/
こちらを参考にしましたが、余計なdll等も含まれてしまったため
以下のようにしてみました。

#if UNITY_EDITOR

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class ExportSetting : MonoBehaviour
{
    [MenuItem("Assets/ExportWithSettings")]
    static void Export()
    {
        string[] assetPaths = {
            "Assets/含めたいフォルダー",
            "ProjectSettings/AudioManager.asset",
            "ProjectSettings/ClusterInputManager.asset",
            "ProjectSettings/DynamicsManager.asset",
            "ProjectSettings/EditorBuildSettings.asset",
            "ProjectSettings/GraphicsSettings.asset",
            "ProjectSettings/InputManager.asset",
            "ProjectSettings/NavMeshAreas.asset",
            "ProjectSettings/NetworkManager.asset",
            "ProjectSettings/Physics2DSettings.asset",
            "ProjectSettings/ProjectSettings.asset",
            "ProjectSettings/QualitySettings.asset",
            "ProjectSettings/TagManager.asset",
            "ProjectSettings/TimeManager.asset",
            "ProjectSettings/UnityConnectSettings.asset"
        };

        string exportPath = "test.unitypackage";

        AssetDatabase.ExportPackage(assetPaths, exportPath, ExportPackageOptions.Interactive | ExportPackageOptions.Recurse);
        
    }
}

#endif

ProjectSettingsは再帰で読まれなかった。

#環境
Unity 2017 4.2.8f1

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?