4
0

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 3 years have passed since last update.

AddressablesとCloud Content Delivery

Last updated at Posted at 2021-03-05

Unity謹製のCDN

個人で使うには十分だと感じました。
当たり前ですがUnityとの相性が抜群です。

導入手順

はりきって書こうと思ったら、ダッシュボードにすべてが書かれていました。
image.png

エディタ拡張から実行するために

以下のようなコマンドをucd.exeと同階層に置きました。

ucd auth login [ログインID]
ucd config set bucket [Bucket ID]
ucd entries sync [同期させるターゲットパス]
echo n | ucd releases create -b [Bucket ID]

バンドルのビルドスクリプトを書く

新規の場合

AddressableAssetSettings.BuildPlayerContent();

Updateの場合

        var aaSettings = AddressableAssetSettingsDefaultObject.Settings;

        if (aaSettings != null && aaSettings.BuildRemoteCatalog)
        {
            var id = aaSettings.profileSettings.GetProfileId("Default");
            aaSettings.activeProfileId = id;

            string path = ContentUpdateScript.GetContentStateDataPath(false);
            if (System.IO.File.Exists(path))
            {
                ContentUpdateScript.BuildContentUpdate(aaSettings, path);
            }
        }

上記を組み合わせれば、ビルド後にバッチを走らせることができます。

4
0
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
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?