コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

2020-04-04から1日間の記事一覧

【Unity】Addressable Asset System で Library/com.unity.addressables フォルダをバージョン管理に含める方法

概要 /[Ll]ibrary/* !/[Ll]ibrary/com.unity.addressables/ .gitignore で Library フォルダの無視の指定を上記のように記述する /[Ll]ibrary/ !/[Ll]ibrary/com.unity.addressables/ このように * が付いていないと反映されないので気をつける /[Ll]ibrary/…

【Unity】Player content must be built before entering play mode with packed data.

概要 Addressable Asset System で Play Mode Script を 「Use Existing Build」にしている状態で Unity を再生した時に Player content must be built before entering play mode with packed data. This can be done from the Addressables window in the …

【Unity】Addressable Asset System ではシーンのアセットバンドルの読み込みに失敗した場合にもシーンの読み込み処理に進んでしまいエラーと例外が発生する

概要 AssetBundleResource でシーンのアセットバンドルのダウンロードに失敗しても シーンの読み込み処理に進んでしまう シーンの読み込み処理は SceneProvider.cs に書かれており、 下記のエラーと例外が発生する Scene 'XXXX' couldn't be loaded because …

【Unity】Android で Addressable Asset System のリモートカタログのキャッシュを削除するスクリプト

概要 var path = $"{Application.persistentDataPath}/com.unity.addressables"; var files = Directory.GetFiles( path, "*", SearchOption.AllDirectories ); foreach ( var file in files ) { File.Delete( file ); } Addresable Asset System でリモート…

【Unity】Addressable Asset System のリモートカタログやアセットバンドルは Android でどこに保存されるか

概要 /storage/emulated/0/Android/data/【Package Name】/files/ リモートカタログのキャッシュは上記フォルダ内の 「com.unity.addressables」フォルダに保存される アセットバンドルのキャッシュは上記フォルダ内の 「UnityCache」フォルダに保存される

【Unity】Addressable Asset System でリモートカタログのキャッシュを削除するエディタ拡張

概要 using System; using System.IO; using UnityEditor; using UnityEngine; public static class Tools { [MenuItem( "Tools/リモートカタログのキャッシュを削除" )] private static void DeleteRemoteCatalogCacheFolder() { var path = $"{Application…

【Unity】Addressable Asset System でリモートカタログのキャッシュのフォルダを開くエディタ拡張

概要 using System; using System.Diagnostics; using UnityEditor; using UnityEngine; public static class Tools { [MenuItem( "Tools/リモートカタログのキャッシュのフォルダを開く" )] private static void OpenRemoteCatalogCacheFolder() { var path…

【Unity】Addressable Asset System で IResourceLocation を Json 形式で出力するための構造体

概要 [Serializable] public struct ResourceLocationJsonData { [SerializeField] private string m_internalId; [SerializeField] private string m_primaryKey; [SerializeField] private string m_providerId; [SerializeField] private string m_resour…

【Unity】Addressable Asset System で InitializeAsync でリモートカタログが読み込めなかった場合も成功になる

概要 InitializeAsync でリモートカタログを読み込む処理は InitializationOperation.CreateInitializationOperation で記述されている リモートカタログをサーバからダウンロードする処理は TextDataProvider.InternalOp.Start で記述されている internalId…

【Unity】Addressable Asset System で InitializeAsync を実行したときに InternalIdTransformFunc で呼び出される InternalId

概要 Windows 10 リモートカタログのファイル名は catalog_1.0.0 RemoteLoadPath は http://localhost/[BuildTarget] 表の横幅がおかしいので気が向いたら直す リモートカタログがキャッシュされていない場合 ResourceType PrimaryKey InternalId ResourceMa…

【Unity】Addressable Asset System でリモートカタログがキャッシュされるフォルダ(Windows 10)

概要 C:\Users\【ユーザー名】\AppData\LocalLow\【Company Name】\【Product Name】\com.unity.addressables InitializeAsync でリモートカタログが読み込まれると 上記フォルダにリモートカタログの .hash と .json が保存される