2023-02-01から1ヶ月間の記事一覧
概要 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 を使用…
概要 Package Manager で「Collections」パッケージをインストールすると使えるようになる
概要 「WhatUsesThisInScene」を Unity プロジェクトに導入することで ゲームオブジェクトが依存しているアセットを確認できるようになります 使い方 Hierarchy でゲームオブジェクトを右クリックして 「What uses this in the scene?」を選択すると ゲーム…
概要 # 現在のバージョンを確認 xcode-select -print-path # バージョンを設定 xcode-select -switch /Applications/Xcode.app/Contents/Developer 補足 xcode-select: error: --switch must be run as root (e.g. `sudo xcode-select --switch <xcode_folder_path>`). もし上記</xcode_folder_path>…
概要 「Speech And Text in Unity iOS and Unity Android」を Unity プロジェクトに導入することで iOS / Android で音声合成(TextToSpeech)使用できるようになります 使い方 using TextSpeech; using UnityEngine; public class Example : MonoBehaviour …
概要 「Unity-EasingAnimationCurve」を Unity プロジェクトに導入することで Ease を AnimationCurve で使用できるようになります 使い方 GitHub リポジトリに含まれている「EasingFunctions.curves」を Unity プロジェクトの Editor フォルダに追加します …
概要 Unity で作成した Android アプリを「arrows Tab F-02K」にインストールしたら Audio がすごくスローで再生される現象に遭遇した Unity の「Project Settings > Audio」で 「DSP Buffer Size」を「Best latency」から「Best performance」に変えたら 正…
概要 using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { private void Awake() { var spriteRenderer = GetComponent<SpriteRenderer>(); var sprite = spriteRenderer.sprite; var polygonCollider2D = GetComponent<PolygonCollider2D>(); var ph</polygoncollider2d></spriterenderer>…
概要 private delegate void Delegate( in Vector2 position ); private void Run( Delegate deletgate ) { deletgate += ( in Vector2 position ) => Debug.Log( position ); } 引数が入力参照渡しであることを明示的に記述する必要がある
概要 if ( AssetDatabase.TryGetGUIDAndLocalFileIdentifier( instanceId, out var guid, out long localId ) ) { Debug.Log( guid ); Debug.Log( localId ); } AssetDatabase.TryGetGUIDAndLocalFileIdentifier を使用する
リポジトリ 導入前 導入後
リポジトリ 使用例 iOSSilentModePlayAudio.SetAudioSession(); 上記の関数を任意のタイミングで呼び出します
概要 using UnityEngine; using UnityEngine.EventSystems; public class Example : MonoBehaviour, IPointerClickHandler { void IPointerClickHandler.OnPointerClick( PointerEventData eventData ) { if ( 0 < eventData.pointerId ) return; Debug.Log(…
概要 ファイル名の末尾が数字のアセットを複製すると デフォルトでは上記のようになってしまうが Project Settings の「Editor > Space Before Number in Asset Names」をオフにすると ファイル名の連番が正しく計算されるようになります
リポジトリ 使用例 using Kogane; using UnityEngine; public class Example : ObsoleteMonoBehaviour { private void Start() { Debug.Log( name ); Debug.Log( enabled ); Debug.Log( transform ); Debug.Log( GetComponent<Transform>() ); } }</transform>
リポジトリ 使用例 using System.Threading; using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public class Example : MonoBehaviour { private readonly CancellationTokenSource m_cancellationTokenSource = new(); private async UniT…
リポジトリ 使用例 Before using System; using Cysharp.Threading.Tasks; using UnityEngine; public class Example : MonoBehaviour { private async UniTaskVoid Start() { await UniTask.Delay( TimeSpan.FromSeconds( 1 ) ); } } After using System; u…
概要 「Editor-View-UnityDomainReloadHelper」を Unity プロジェクトに導入することで Enter Play Mode で static 変数の初期化ができる Attribute を使えるようになります 使い方 using UnityEngine; public class Example : MonoBehaviour { // 0 で初期…
概要 「Editor-View-TransformChanged helper」を Unity プロジェクトに導入することで Transform が変化したことを検知できるようになります 使い方 using Needle.TransformExtensions; using UnityEngine; public class Example : MonoBehaviour { private…