概要 private int Rows => ( DataCount - 1 ) / startAxisCellCount + 1; FancyGridView を継承したクラスで上記のようなコードを記述することで 行数を取得できる
概要 FancyScrollRect のスクロール位置をリセットするために UpdatePosition( 0 ); 上記の処理を呼び出したら、要素の行数によって リセット後のスクロール位置がズレる現象に遭遇した Scroller.Position = 0; 上記の処理に書き換えたらズレることはなくな…
概要 FancyScrollRect のスクロールの速度は Scroller クラスの velocity で管理されているが velocity は private なので外部から操作できない /// <summary> /// 現在のスクロール位置. /// </summary> /// <value></value> public float Position { get => currentPosition; set { autoScrol…
はじめに https://gist.github.com/nukadelic/47474c7e5d4ee5909462e3b900f4cb82 「EditorFontSize」を Unity プロジェクトに導入することで Unity エディタのフォントサイズを変更できるようになります 使用例
概要 using System.CodeDom.Compiler; using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var provider = CodeDomProvider.CreateProvider( "C#" ); Debug.Log( provider.IsVa…
概要 「Editor-View-Modules」を Unity プロジェクトに導入することで エディタのツールバーとステータスバーを非表示にできるようになります 使い方 Unity メニューの「View > Toolbars」の項目を選択すると エディタのツールバーとステータスバーを非表示…
はじめに 「A minimal spring physics library for Unity」を Unity プロジェクトに導入することで シンプルなバネの動きを実装できるようになります 使用例 using UnityEngine; public class Example : MonoBehaviour { private UnitySpring.ClosedForm.Spr…
はじめに 「com.bovinelabs.core」を Unity プロジェクトに導入することで NativeList や NativeArray の拡張メソッドが使えるようになります NativeList の拡張メソッド https://gitlab.com/tertle/com.bovinelabs.core/-/blob/master/BovineLabs.Core/Exte…
はじめに 「Native Collections」を Unity プロジェクトに導入することで Job System で二次元配列が使えるようになります 使用例 using JacksonDunstan.NativeCollections; using Unity.Collections; using UnityEngine; public class Example : MonoBehavi…
概要 [3.0.0-pre.1] - 2021-04-07 Removed legacy Recorders: MP4, EXR, PNG, WEBM and GIF Animation.
リポジトリ 使用例 using System.Threading; using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public class Example : MonoBehaviour { private async UniTaskVoid Start() { var cancellationTokenSource = new CancellationTokenSource(…
通常 [MenuItem( "Tools/Hoge" )] private static void Hoge() { var assetPath = ""; var prefabRoot = PrefabUtility.LoadPrefabContents( assetPath ); foreach ( var x in prefabRoot.GetComponentsInChildren<SpriteRenderer>() ) { Object.DestroyImmediate( x ); } Pr</spriterenderer>…
リポジトリ 使用例 using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { public GameObject m_prefab; private void Awake() { var r1 = m_prefab.Instantiate(); var r2 = m_prefab.Instantiate( Vector3.zero ); var r3 = m_…
概要 Console ウィンドウは通常は上記のような見た目ですが Console ウィンドウのタブを右クリックして「Use Monospace font」を押すと 等幅フォントを使用した見た目になります
概要 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…
概要 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…
概要 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 メニューの「Edit > Project Settings...」を選択して 「Audio > DSP Buffer Size」を「Best latency」にします
概要 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 に…
ソースコード using Unity.Collections; namespace Kogane { public static class NativeArrayExtensionMethods { public static void Reverse<T>( this NativeArray<T> self ) where T : unmanaged { var halfLength = self.Length / 2; var i = 0; var j = self.</t></t>…
概要 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…
概要 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…
概要 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) …
概要 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…
ソースコード using Unity.Collections; namespace Kogane { public static class NativeListExtensionMethods { public static void Reverse<T>( this NativeList<T> self ) where T : unmanaged { var halfLength = self.Length / 2; var i = 0; var j = self.Le</t></t>…
概要 【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…
概要 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…
概要 using UnityEngine; public class Example : MonoBehaviour { private void Awake() => Log1(); [HideInCallstack] private void Log1() => Log2(); [HideInCallstack] private void Log2() => Log3(); [HideInCallstack] private void Log3() => Log4(…
概要 public struct Example : IJob { void IJob.Execute() { var list = new NativeList<int>( Allocator.Persistent ); } } 上記のように IJob.Execute の中で Allocator.Persistent を指定して NativeList を生成したら System.InvalidOperationException: Job</int>…
概要 (0,0): Burst error BC1045: Struct `XXXX&` with auto layout is not supported IJob インターフェイスを実装する構造体を定義した際に 上記のエラーが発生する現象に遭遇した public (int, int) value { get; set; } 上記のように ValueTuple を使用…