はじめに 「UnityCommandLineParser」を Unity プロジェクトに導入することで ゲーム実行時にコマンドライン引数を受け取れるようになります 使用例 using UnityCommandLineParser; using UnityEngine; using UnityEngine.UI; public class Example : MonoBe…
はじめに 「Hierarchy Window Extensions」を Unity プロジェクトに導入することで Hierarchy でゲームオブジェクトのアイコンの代わりに コンポーネントのアイコンが表示できるようになります 導入前 導入後
はじめに 「Raycast Visualization」を Unity プロジェクトに導入することで Raycast などを Scene ウィンドウで可視化できるようになります 使用例 using Nomnom.RaycastVisualization; using UnityEngine; public class Example : MonoBehaviour { private…
はじめに 「Folder Importer Presets」を Unity プロジェクトに導入することで フォルダに適用する Preset を簡単に設定できるようになります 使用例 Project ウィンドウで「+ > Nomnom > Folder Importer」を選択して Folder Importer を作成したら Folder …
はじめに 「Drop-down with objects of any type in Unity Inspector」を Unity プロジェクトに導入することで const や static readonly を Inspector のドロップダウンで選択できるようになります 使用例 using StructDropDown; using UnityEngine; public…
概要 [Package Manager Window] Cannot perform upm operation: Unable to add package [AAAA]: Package BBBB@AAAA has invalid dependencies or related test packages: CCCC (dependency): Package [CCCC@DDDD] cannot be found [NotFound]. UnityEditor.E…
はじめに 「MissingScriptType」を Unity プロジェクトに導入することで Missing になっているスクリプトの名前がわかるようになります 導入前 導入後 Missing になっているスクリプトの名前は「NewBehaviourScript」だとわかる 注意 パッケージ導入前に Mis…
はじめに 「Debug Draw API for Unity」を Unity プロジェクトに導入することで デバッグ用にギズモを簡単に描画できるようになります 使用例 using Oddworm.Framework; using UnityEngine; public class Example : MonoBehaviour { private void Update() {…
はじめに 「UI Culling for Unity」を Unity プロジェクトに導入することで UI が他の UI の範囲に入ったかどうかを検知できるようになります 使用例 使い方 UICullingBehaviour コンポーネントを使用して using Oddworm.Framework; using UnityEngine; publ…
はじめに 「Selection Detective」を Unity プロジェクトに導入することで レイヤーやタグ・マテリアル・シェーダ・フィールドなどで ゲームオブジェクトを検索できるようになります 使用例 Hierarchy で右クリックして「Selection Detective」を押して Sele…
はじめに 「Project Window Extensions」を Unity プロジェクトに導入することで Project ウィンドウでカット & ペーストが可能になります 使用例 その他 他にもテキストファイルや JSON ファイルを作成できるようになります
はじめに 「ScreenSwipe」を Unity プロジェクトに導入することで スワイプできる UI を簡単に実装できるようになります 使用例 クイックスタート Hierarchy の「+ > UI > Screen Swipe」の 「Screen Swipe」と「Pagination」を押して このようにゲームオブ…
はじめに 「Vertx.Editors」を Unity プロジェクトに導入することで 指定したコンポーネントがアタッチされているプレハブを検索できるようになります 使用例 スクリプトの Inspector で「Search for XXXX」を押すと そのコンポーネントがアタッチされている…
はじめに 「NSelection」を Unity プロジェクトに導入することで Scene ウィンドウで重なっているゲームオブジェクトを簡単に選択できるようになります 使用例 Scene ウィンドウで Ctrl + 右クリックすると 重なっているゲームオブジェクトを簡単に選択でき…
概要 warning: You are currently using Visual Studio 2019 to compile and link C++ code. It is recommended that you upgrade to Visual Studio 2022 for better performance. Unity で PC 向けに IL2CPP ビルドしたらビルド完了時に上記の警告が出力さ…
概要 error: Build path contains project built with Mono scripting backend, while current project is using IL2CPP scripting backend. Consider building your project into an empty directory. Unity で PC 向けにビルドしたら上記のエラーが発生す…
スクリプト 上記のスクリプトをシーンのゲームオブジェクトにアタッチして実行すると オブジェクトプールの動作を確認できます 実行例 プールにオブジェクトが不足している場合は新規で生成されます プールに非アクティブなオブジェクトが存在する場合は 新…
概要 C:\Users\【ユーザー名】\AppData\Roaming\UnityHub
はじめに この記事では Unity Hub 3 で Unity プロジェクトを新規作成する時に 独自のプロジェクトテンプレートを選択できるようにする方法を紹介していきます 環境 Windows 10 Unity 2021.3.1f1 Unity Hub 3.1.2 手順 【Unity のインストール先】\Editor\Da…
概要 自動再生はユーザーが承認したとき、サイト別設定で許可したとき、 またはメディアがミュートのときだけ許可されます。 Build.framework.js.gz:3:48743 Uncaught (in promise) DOMException: The play method is not allowed by the user agent or the …
概要 WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. Build.loader.js:1:9894 [UnityCache] Failed to load 'http://localhost:51173/Build/Build.data.br' from indexedDB cache due to the error: TypeEr…
概要 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD Unity で WebGL ビルドしたら上記のエラーが発生して Audio が再生されない現象に遭遇した 上記の記事の対応を…
概要 Audio Source の Play On Awake をオンにしたり m_audioSource.Play(); スクリプトから Awake や Start のタイミングで Play 関数を呼び出した場合、 Unity エディタでは正常に Audio が再生されても WebGL でビルドすると Audio が再生されなくなりま…
ソースコード using JetBrains.Annotations; using Unity.Collections; public static class SourceTemplates { [SourceTemplate] [Macro( Target = "index" )] [Macro( Target = "value" )] public static void @for<T>( this NativeArray<T> self ) where T : st</t></t>…
概要 InvalidOperationException: Trying to release an object that has already been released to the pool. Unity のオブジェクトプールを使用した時に上記のエラーが発生する現象に遭遇した m_objectPool.Release( gameObject ); すでにプールに戻されて…
概要 Package Manager の「+ > Add package by name...」を選択して com.unity.textmeshpro と 3.2.0-pre.3 と入力して「Add」を押します
概要 var animationDataArray = entityQuery .ToComponentDataArray<XXXX>( Allocator.TempJob ); ECS で上記のようなコードを書いたら A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details. こ</xxxx>…
はじめに 「Editor-View-Modules」を Unity プロジェクトに導入することで エディタのツールバーやステータスバーを非表示にできるようになります 使用例
概要 Game ウィンドウの「Gizmos」をオンにすると描画される
ソースコード private static Mesh CreateMesh( float width, float height ) { var halfWidth = width / 2; var halfHeight = height / 2; var vertices = new[] { new Vector3( -halfWidth, -halfHeight ), new Vector3( -halfWidth, +halfHeight ), new V…