コガネブログ

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

【Unity】LateUpdate で ScrollRect.horizontalNormalizedPosition を参照した時に位置が微妙ズレる場合

概要 private void LateUpdate() { var x = Mathf.LerpUnclamped( m_minX, m_maxX, m_scrollRect.horizontalNormalizedPosition ); // ... } LateUpdate で ScrollRect.horizontalNormalizedPosition を参照して ゲームオブジェクトの X 座標を設定しようと…

【Unity】Consider updating External Editor in Unity to Rider 2023.1.

概要 Consider updating External Editor in Unity to Rider 2023.1. JetBrains Rider を 2023.1 にアップデートしたら Unity で上記の警告が出力された Package Manager で「JetBrains Rider Editor」をアップデートしたら出力されなくなった

【Unity】Scrmizu で NullReferenceException

概要 NullReferenceException: Object reference not set to an instance of an object Scrmizu.InfiniteScrollBinderBase.Hide () (at Library/PackageCache/com.comcreate-info.scrmizu@db67f77edb/Scripts/Runtime/InfiniteScrollBinderBase.cs:41) Scrmi…

【Unity】Performance warning: There are more than 100 preview scenes.

概要 Performance warning: There are more than 100 preview scenes. There might be code not releasing the preview scene after creating it. UnityEditor.InspectorWindow:RedrawFromNative () PrefabUtility.LoadPrefabContents でプレハブを大量に読…

【Unity】#XX pc XXXX libGLES_mali.so (BuildId: xxxx)

概要 Crashed: Thread: SIGSEGV 0x0000000000000018 #00 pc 0x1679eb8 libGLES_mali.so (BuildId: bec4c595930d3102) #01 pc 0x164c33c libGLES_mali.so (BuildId: bec4c595930d3102) #02 pc 0x76b880 libGLES_mali.so (BuildId: bec4c595930d3102) #03 pc 0…

【Unity】#XX pc XXXX vulkan.adreno.so (BuildId: xxxx)

概要 Crashed: Thread: SIGSEGV 0x0000000000000008 #00 pc 0x9f9e0 vulkan.adreno.so (BuildId: a60862ea38912bb349d7bd52158d8d1e) #01 pc 0x65b5a8 libunity.so (BuildId: 865c87ab195e0bea933b151e18821a8a99807213) Android で上記のようなログが出てア…

【Unity】#XX pc XXXX libvulkan.so (BuildId: xxxx)

概要 Crashed: Thread: SIGSEGV 0x0000000000000058 #00 pc 0x1087a libvulkan.so (BuildId: fc680eaf7f09c8ebc443ec23f5e310e1) #01 pc 0x4f1932 libunity.so (BuildId: f3b0f4c78454a5df12133c9afff00d61d8074e13) #02 pc 0x531476 libGLES_mali.so (Build…

【Unity】3D Object の TextMesh Pro で中心の位置がズレる場合

概要 Alignment を上記のように設定したら解決した

【Unity】DOTWEEN ► This Tween has been killed and is now invalid

概要 if ( m_tween != null && m_tween.IsPlaying() ) return; DOTween で上記のようなコードを記述したら DOTWEEN ► This Tween has been killed and is now invalid 上記の警告が発生する現象に遭遇した if ( m_tween != null && m_tween.IsActive() && m_…

【Unity】Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.

概要 Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s) at System.…

【Unity】TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 30717

概要 TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 30717 Internal: Stack allocator ALLOC_TEMP_MAIN has unfreed allocations, size 30717 To Debug, run app with -diag-temp-memory-leak-validat…

【Unity】TreeView で検索した時に要素の表示順が変わってしまう場合

概要 protected override bool DoesItemMatchSearch ( TreeViewItem treeViewItem, string search ) { // ... } TreeView の DoesItemMatchSearch をオーバーライドして検索処理を実装した際に、 MultiColumnHeader の sortedColumnIndex が無視されてしまう…

【Unity】Animation で SpriteRenderer のスプライトを変更できない場合

概要 Animator を使用する必要がある 参考サイト様

【Unity】Unity Recorder 3.0.0 で GIF Animation Recorder は削除された

概要 [3.0.0-pre.1] - 2021-04-07 Removed legacy Recorders: MP4, EXR, PNG, WEBM and GIF Animation.

【Unity】Console ウィンドウで等幅フォントを使用する方法

概要 Console ウィンドウは通常は上記のような見た目ですが Console ウィンドウのタブを右クリックして「Use Monospace font」を押すと 等幅フォントを使用した見た目になります

【Unity】Generated streamable assets list has XXXX asset names and extensions

概要 Generated streamable assets list has XXXX asset names and extensions. Having more than 600 values might cause building errors in exported project. Consider using distinct extentions for streaming assets (such that are not used by othe…

【Unity】adb: failed to install YYYY.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package ZZZZ signatures do not match previously installed version; ignoring!]

概要 CommandInvokationFailure: Unable to install APK to device. 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.1.23f1/PlaybackEn…

【Unity】Unknown error occurred while loading 'Assets/StreamingAssets/XXXX.prefab'.

概要 Unknown error occurred while loading 'Assets/StreamingAssets/XXXX.prefab'. UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37) UnityEditor.AssetDatab…

【Unity】No cloud project ID was found by the Analytics SDK.

概要 No cloud project ID was found by the Analytics SDK. This means Analytics events will not be sent. Please make sure to link your cloud project in the Unity editor to fix this problem. Unity 2018 で作られたプロジェクトを Unity 2022.1 に…

【Unity】The property database "Library/Search/propertyDatabase.db" is already opened.

概要 The property database "Library/Search/propertyDatabase.db" is already opened. UnityEditor.EditorApplication:Internal_InvokeTickEvents () The property database "Library/Search/propertyAliases.db" is already opened. UnityEditor.EditorAp…

【Unity】Building Library/Bee/artifacts/Android/19qtv/libil2cpp.so failed with output:

概要 Building Library/Bee/artifacts/Android/19qtv/libil2cpp.so failed with output: /Applications/Unity/Hub/Editor/2022.1.23f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/../sysroot/usr/lib/aarch64-linux-and…

【Unity】ArgumentException: source and destination length must be the same

概要 nativeArray.CopyFrom( array ); NativeArray.CopyFrom を使用した時に ArgumentException: source and destination length must be the same Unity.Collections.NativeArray`1[T].CheckCopyLengths (System.Int32 srcLength, System.Int32 dstLength) …

【Unity】DllNotFoundException: Unable to load DLL 'FirebaseCppApp-9_6_0'.

概要 DllNotFoundException: Unable to load DLL 'FirebaseCppApp-9_6_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-9_6_0' because of 'Failed to open the requested dynamic library (0x0600000…

【Unity】(0,0): Burst error BC0101: Unexpected error while processing function `XXXX.Unity.Jobs.IJob.Execute(XXXX* this) -> void_48866e3ad5c81254d9a4276b3d04e704 from YYYY, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null`: System.NullReferenceExceptio

概要 【Unity プロジェクト】\Library\PackageCache\com.unity.burst@1.7.4\.Runtime\bcl.exe exited after 980 ms. Unexpected error while processing function `XXXX.Unity.Jobs.IJob.Execute(XXXX* this) -> void_48866e3ad5c81254d9a4276b3d04e704 from…

【Unity】System::InvalidOperationException: The UNKNOWN_OBJECT_TYPE has been declared as [WriteOnly] in the job, but you are reading from it.

概要 System::InvalidOperationException: The UNKNOWN_OBJECT_TYPE has been declared as [WriteOnly] in the job, but you are reading from it. This Exception was thrown from a job compiled with Burst, which has limited exception support. Job Sy…

【Unity】System.InvalidOperationException: Jobs can only create Temp memory

概要 public struct Example : IJob { void IJob.Execute() { var list = new NativeList<int>( Allocator.Persistent ); } } 上記のように IJob.Execute の中で Allocator.Persistent を指定して NativeList を生成したら System.InvalidOperationException: Job</int>…

【Unity】(0,0): Burst error BC1045: Struct `XXXX&` with auto layout is not supported

概要 (0,0): Burst error BC1045: Struct `XXXX&` with auto layout is not supported IJob インターフェイスを実装する構造体を定義した際に 上記のエラーが発生する現象に遭遇した public (int, int) value { get; set; } 上記のように ValueTuple を使用…

【Unity】NativeHashMap が見つからない場合

概要 Package Manager で「Collections」パッケージをインストールすると使えるようになる

【Unity】特定の Android 端末で Audio がすごくスローで再生される場合

概要 Unity で作成した Android アプリを「arrows Tab F-02K」にインストールしたら Audio がすごくスローで再生される現象に遭遇した Unity の「Project Settings > Audio」で 「DSP Buffer Size」を「Best latency」から「Best performance」に変えたら 正…

【Unity】IDisposableAnalyzers を導入したらビルド時間が長くなった

概要 項目 ビルド時間 導入前 1 分 29 秒 導入後 2 分 43 秒 検証環境 Unity 2022.1.23f1 macOS Monterey バージョン 12.5.1 MacBook Pro 2021 Android Mono2x ビルド