コガネブログ

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

2020-04-01から1ヶ月間の記事一覧

【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 が保存される

【Unity】Addressable Asset System のカタログの種類

概要 AddressablesMainContentCatalog ローカルカタログ AddressablesMainContentCatalogRemoteHash リモートカタログ AddressablesMainContentCatalogCacheHash ダウンロードしたリモートカタログが保存される場所 インターネットにアクセスせずにゲームを…

【Unity】Addressable Asset System で Resources フォルダや Build Settings に登録しているシーンを含めない方法

概要 Project ビューで Build In Data.asset を選択して Include Resources Folders Include Build Setting Scenes のチェックを外す

【Unity】Addressable Asset System の CheckForCatalogUpdates や UpdateCatalogs の基本的な使い方

概要 Debug.Log( "CheckForCatalogUpdates 開始" ); // リモートカタログの更新があるかどうか確認する Addressables.CheckForCatalogUpdates().Completed += checkHandle => { Debug.Log( $"CheckForCatalogUpdates 終了:{checkHandle.Status}" ); // 更新…

【雑記】WinMerge で差分のみが表示されるようになった場合に元に戻す方法

概要 WinMerge メニューの「表示 > Diffコンテキスト > 全て」を選択する

【Unity】iOS でダークモードかどうかを判定する方法がまとめられたサイト様

概要 https://forum.unity.com/threads/unity-ios-dark-mode.805344/ https://gist.github.com/mao-test-h/b1cea20820832499a7e7942589db7e48

【Unity】Windows の Standalone ビルドに Visual Studio の Unity デバッガをアタッチする方法

概要 Build Settings で「Development Build」と「Script Debugging」をオンにしてビルドして Visual Studio メニューの「デバッグ > Unity デバッガーのアタッチ」を押して 「WindowsPlayer」を選択して「OK」を押す 参考サイト様

【Unity】Addressable Asset System の Profile の各種パスには自作の静的プロパティを指定できる

概要 public static class Hoge { public static string Fuga => "ピカチュウ"; } 例えば上記のような静的プロパティが存在する場合、 [Hoge.Fuga]/[BuildTarget] のような記述で Profile の LocalBuildPath や LocalLoadPath などに指定できる このプロパテ…

【Unity】Addressable Asset System 1.7.4 だと AddressableAssetSettings の設定を Inspector で変更して Ctrl + S を押しても保存されない

概要 Addressable Asset System 1.7.4 だと AddressableAssetSettings の設定を Inspector で変更して Ctrl + S を押しても保存されない 1.7.5 も同様だった Inspector を Debug モードにして値を変更した場合は正常に保存できる

【おすすめスライド】「CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例」

スライド

【Unity】Addressable Asset System のデフォルトの Profile の各パス

概要 項目 内容 BuildTarget [UnityEditor.EditorUserBuildSettings.activeBuildTarget] LocalBuildPath [UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget] LocalLocadPath {UnityEngine.AddressableAssets.Addressables.RuntimePath}/…

【Unity】Addressable Asset System におけるプラットフォーム情報を取得する方法

概要 PlatformMappingService.GetPlatform を使用すると AddressablesPlatform という列挙型でプラットフォーム情報を取得できる Unity エディタ上であれば、EditorUserBuildSettings.activeBuildTarget に紐づく AddressablesPlatform の値が返ってくる そ…

【Unity】Addressable Asset System で BuildPath や RuntimePath などを参照するとどのような文字列を取得できるか

概要 BuildPath "Library/com.unity.addressables/StreamingAssetsCopy/" + StreamingAssetsSubFolder + "/" + PlatformMappingService.GetPlatform() PlayerBuildDataPath Application.streamingAssetsPath + "/" + StreamingAssetsSubFolder + "/" + Platf…

【Unity】Addressable Asset System で Bundle Naming を Use Hash of Filename にした時に生成されるハッシュを取得する方法

概要 [MenuItem( "Tools/Hoge" )] private static void Hoge() { var filename = "【アセットバンドルのファイル名】"; var hash = HashingMethods.Calculate( filename ); Debug.Log( hash ); } HashingMethods.Calculate を使用する アセットバンドルのフ…

【Unity】Addressable Asset System で Bundle Naming を Filename にした時にどのようにパッキングされるか

概要 グループ内のシーンファイル 【グループ名の lowercase】_scenes_all.bundle という名前のアセットバンドルに含まれる グループ内のシーンファイル以外のアセット 【グループ名の lowercase】_assets_all.bundle という名前のアセットバンドルに含まれ…

【Unity】Addressable Asset System の DownloadDependenciesAsync の引数に渡せる key

渡せるもの アドレス ラベル 英数字の羅列のアセットバンドル名 渡せないもの アセットバンドル名 Status に Succeeded が返ってくるが、何もダウンロードされない

【Unity】Addressable Asset System でカタログをダウンロードする時に使用される Provider

概要 ContentCatalogProvider が JsonAssetProvider を使用している ContentCatalogProvider.cs 64行目 JsonAssetProvider は TextDataProvider を継承している TextDataProvider にダウンロード処理が記載されている

【おすすめスライド】「Android向けUnity製ゲーム最適化のためのCI/CDと連携した自動プロファイリングシステム」

スライド

【おすすめスライド】「Jenkinsの構成・運用パターン」

スライド