コガネブログ

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

2025-01-01から1年間の記事一覧

【Unity】NotSupportedException: Specified method is not supported.

概要 NotSupportedException: Specified method is not supported. UnityEditor.Search.PropertyTable..ctor (System.String serializationUID, UnityEditor.Search.ITableView tableView) (at /Users/bokken/build/output/unity/unity/Modules/QuickSearch/…

【Unity】色付きのタイルを描画するシンプルなタイルマップ

ソースコード Setup メソッドで指定した位置に色を設定できる。 サイズが 128x128 以内ならIndexFormat.UInt16 にしても正常に動作する。 128x128 以上なら IndexFormat.UInt32 にしないと正常に描画されない。

【Unity】ブラウザで Unity プロジェクトの GUID をアセット名に変換して表示してくれるパッケージ

リポジトリ

【Unity】Embedded package [XXXX] was found in the directory [YYYY]. Please consider changing the directory name to match the package name.

概要 Embedded package [XXXX] was found in the directory [YYYY]. Please consider changing the directory name to match the package name. Unity プロジェクトのバージョンを 2022.3 から 6000.0 にアップデートしたら 上記の警告が出力される現象に遭…

【Unity】[CXX1100] android.ndkVersion is [27.0.12077973] but android.ndkPath /Applications/Unity/Hub/Editor/6000.0.64f1/PlaybackEngines/AndroidPlayer/NDK refers to a different version [27.2.12479018].

概要 Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details > Configure project :unityLibrary Variant 'debug', will keep symbols in binaries for: 'libunity.so' 'libil2cpp.so' 'libmain.so' Variant 'release'…

【Chrome】YouTube トップページのサムネイルのサイズを調整する Tampermonkey 用のユーザースクリプト

概要 // ==UserScript== // @name YouTube トップページのサムネイルのサイズを調整 // @description YouTube トップページのサムネイルのサイズを調整 // @version 0.1 // @match https://www.youtube.com/* // ==/UserScript== (function () { 'use strict…

【Unity】CircleCollider2D の Offset と Radius を Sprite に合わせて調整する拡張メソッド

ソースコード using System.Collections.Generic; using UnityEngine; namespace Kogane { public static class CircleCollider2DExtensionMethods { public static IReadOnlyList<CircleCollider2D> UpdateFromSprite ( this IReadOnlyList<CircleCollider2D> self, IReadOnlyList<Sprite> sprites ) { f</sprite></circlecollider2d></circlecollider2d>…

【雑記】軽量な Android 端末

概要 端末 高さ×幅×厚み(mm) 重量(g) Google Pixel 9a 154.7×73.3×8.9 186.0 Google Pixel 8a 152.1×72.7×8.9 189.0 Google Pixel 7a 152.0×72.9×9.0 193.5 Google Pixel 6a 152.2×71.8×8.9 178.0 Galaxy S25 146.9×70.5×7.2 162.0 Galaxy S24 147.0×70.6×7.…

【雑記】/usr/local/bin/firebase: line 1: Not: command not found

概要 /usr/local/bin/firebase: line 1: Not: command not found Firebase の CLI を最新版に更新したら上記のエラーが発生するようになった。 head -n 5 /usr/local/bin/firebase ターミナルで上記のコマンドを実行したら Not Found% と表示される状態だっ…

【雑記】POCO F7 を購入した時に参考にしたサイト様

概要

【Unity】CommandInvokationFailure: Unable to query OpenGL version information.

概要 CommandInvokationFailure: Unable to retrieve device features information. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. /Applications/Unity/Hub/Editor/2022.3.…

【Android】Mac で Android 端末のアプリを簡単に管理できる「Debloatfy」

概要 Windows には「ADB AppControl」というツールがあるが、 これと同等の機能を持つ Mac 用のアプリを調べていたところ 「Debloatfy」というアプリが使いやすかった。 Android 端末の開発者向けオプションを有効にして、 USB デバッグをオンにして Mac に…

【Unity】POCO F7 にビルドしたアプリの動作が重かった時にやったこと

概要 Android 端末の POCO F7 で開発中の Unity アプリのエージングテストを実行してみたら 妙に時間がかかる状態だった。 端末 テストにかかった時間 AnTuTu Benchmark のスコア POCO F7 1 時間 53 分 2179683 Pixel 6a 1 時間 12 分 941863 ベンチマークの…

【Unity】CommandInvokationFailure: Unable to query OpenGL version information.

概要 CommandInvokationFailure: Unable to query OpenGL version information. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. /Applications/Unity/Hub/Editor/2022.3.62f2…

【Unity】DeploymentOperationFailedException: Installation failed. See the Console for details.

概要 DeploymentOperationFailedException: Installation failed. See the Console for details. at UnityEditor.Android.AndroidDeploymentTargetsExtension.UploadAPK (UnityEditor.Android.AndroidBuildProperties buildProperties, UnityEditor.Android.…

【Unity】Gradient クラスから部分範囲を切り出すメソッド

ソースコード using System.Collections.Generic; using UnityEngine; namespace Kogane { public static class GradientExtensionMethods { public static Gradient GetSubGradient ( this Gradient self, float min, float max ) { min = Mathf.Clamp01( m…

【Unity】Gradient クラスで虹色を作る例

概要 var gradient = new Gradient(); var colorKeys = new GradientColorKey[] { new( Color.red, 0 ), new( new Color( 1, 0.5f, 0 ), 0.16f ), new( Color.yellow, 0.33f ), new( Color.green, 0.5f ), new( Color.cyan, 0.66f ), new( Color.blue, 0.83f…

【Unity】Unity Hub で「アカウントを切り替え」「サインアウト」ができない場合

概要 Mac の Unity Hub 3.15.3 で「アカウントを切り替え」「サインアウト」を押しても 何も反応しない現象に遭遇した。 ~/Library/Application Support/UnityHub Unity Hub を終了してから上記のフォルダを削除して Unity Hub を開いたら別のアカウントでサ…

【Unity】Error building Player: Failed to find entry-points

概要 Error building Player: Failed to find entry-points: System.Exception: Could not resolve assembly 'XXXX, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' referenced by the assembly 'YYYY, Version=0.0.0.0, Culture=neutral, PublicK…

【Mac】CleanShot X で Studio Display のスクショを撮影するときに画像解像度を縮小する方法

概要 CleanShot X で Studio Display のスクショを撮影すると スクショの画像解像度が 2 倍になってしまう。 「Settings... > Screenshots」を開いて「Scale Retina screenshots to 1x」をオンにすると 画像解像度が 2 倍になることを防げる。

【Unity】Android SDK not found

概要 If command-line tools are installed, but this message is still shown, please restart the Unity editor. 新しい Mac に Unity 2022.3.62f2 をインストールして CLI で Android ビルドしたら 上記のメッセージが出力されてビルドに失敗する現象に遭…

【C#】.Replace( "\\", "/" ) よりも .Replace( '\\', '/' ) の方が速い

検証結果 検証用スクリプト using UnityEngine; using UnityEngine.Profiling; public class Example : MonoBehaviour { private void Update() { const string path = "Assets\\material.mat"; const int count = 100000; Profiler.BeginSample( "\"" ); fo…

【C#】Path.ChangeExtension でファイルパスから拡張子を取り除ける

概要 const string path = "Assets/material.mat"; var result = Path.ChangeExtension( path, null ); // Assets/material null ではなく string.Empty を渡すと Assets/material. のように 末尾に . が残ってしまうので注意。

【Unity】Split Application Binary を有効にしてビルドした App Bundle を端末にインストールするスクリプト

ソースコード 関連記事

【Unity】Android モジュールに含まれている bundletool-all-*.jar のパスを取得するスクリプト

ソースコード

【Unity】App Bundle size warning

概要 App Bundle size warning Your release App Bundle is bigger than 200 MB. Do you want to compute the min and max download sizes of APKs generated from your App Bundle? You can turn off this warning or adjust threshold value in Android Pl…

【Firebase App Distribution】Failed to upload release. There's been an error processing your distribution. Ensure you are uploading a valid IPA or APK and try again.

概要 Failed to upload release. There's been an error processing your distribution. Ensure you are uploading a valid IPA or APK and try again. Additional information about this error: APK cannot be analyzed using aapt dump badging. Firebase…

【Firebase App Distribution】Error: This project is not linked to a Google Play account.

概要 Error: This project is not linked to a Google Play account. Firebase CLI で Firebase App Distribution に .aab をアップロードしようとしたら 上記のエラーが発生する現象に遭遇した。 .aab をアップロードする場合は Firebase プロジェクトと Go…

【Trello】画面下のバーを消す方法

概要 「uBlock Origin Lite」をブラウザに追加して Trello のページを開いた状態で「カスタムフィルターの作成」を押して 画面下のバーを選択して 「作成」を押すと、画面下のバーを消すことができる。

【Unity】Unity エディタで Scenes In Build に登録していないシーンを再読み込みする例

スクリプト var activeScene = SceneManager.GetActiveScene(); EditorSceneManager.LoadSceneInPlayMode ( path: activeScene.path, parameters: new LoadSceneParameters( LoadSceneMode.Single ) );