コガネブログ

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

2022-09-05から1日間の記事一覧

【Unity】ディープリンクで Unity のアセットを開く例

概要 using Needle.Deeplink; using UnityEditor; using UnityEngine; internal static class Example { [DeepLink( RegexFilter = @"com.unity3d.kharma:open-asset\/(.*)" )] private static bool OpenAsset( string assetName ) { Debug.Log( assetName )…

【Unity】ディープリンクでゲームオブジェクトの PingObject を実行する例

概要 using Needle.Deeplink; using UnityEditor; using UnityEngine; internal static class Example { [DeepLink( RegexFilter = @"com.unity3d.kharma:ping-game-object\/(.*)" )] private static bool PingGameObject( string gameObjectName ) { Debug.…

【Unity】ディープリンクでアセットの PingObject を実行する例

概要 using Needle.Deeplink; using UnityEditor; using UnityEngine; internal static class Example { [DeepLink( RegexFilter = @"com.unity3d.kharma:ping-asset\/(.*)" )] private static bool PingAsset( string assetPath ) { Debug.Log( assetPath )…

【Unity】ディープリンクで MenuItem を実行する例

概要 using Needle.Deeplink; using UnityEditor; using UnityEngine; internal static class Example { [DeepLink( RegexFilter = @"com.unity3d.kharma:execute-menu-item\/(.*)" )] private static bool ExecuteMenuItem( string menuItemPath ) { Debug.…

【Unity】エディタ拡張で検索欄を簡単に表示する方法

概要 using UnityEditor; using UnityEditor.IMGUI.Controls; public class Example : EditorWindow { private SearchField m_searchField; private string m_text; [MenuItem( "Tools/Hoge" )] private static void Open() { GetWindow<Example>(); } private void O</example>…

【Unity】CompilationPipeline.compilationFinished の中で EditorApplication.delayCall は呼ばれない

概要 [InitializeOnLoadMethod] private static void Hoge() { CompilationPipeline.compilationFinished += _ => { Debug.Log( "ピカチュウ" ); // 呼ばれる EditorApplication.delayCall += () => { Debug.Log( "カイリュー" ); // 呼ばれない }; }; } Ass…

【Unity】Scene Template の Thumbnail の Preview に画像を設定するとエラーが出る

概要 Assertion failed on expression: 'IsInSyncWithParentSerializedObject()' UnityEditor.RetainedMode:UpdateSchedulers () Scene Template の Thumbnail の Preview に画像を設定すると Project ウィンドウで Scene Template を選択するたびに 上記の…

【Unity】Scene Template からシーンを作成するエディタ拡張

概要 using UnityEditor; using UnityEditor.SceneTemplate; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var sceneTemplateAssetPath = "【.scenetemplate のパス】"; var scenePath = "【…

【Unity】パッケージを埋め込みパッケージに変更できるボタンを Inspector に表示するエディタ拡張

ソースコード using System.IO; using UnityEditor; using UnityEditor.PackageManager; using UnityEditorInternal; using UnityEngine; namespace Kogane.Internal { [InitializeOnLoad] internal static class PackageEmbedder { static PackageEmbedder(…