概要 using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { Debug.Log( Selection.count ); } }
概要 using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var position = new Rect( 0, 0, 960, 1280 ); EditorGUIUtility.SetMainWindowPosition( position ); } }
概要 using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var path = "Assets/Prefab.prefab"; // 従来:string 型で GUID を取得 var guidString = AssetDatabase.AssetPathTo…
概要 using UnityEditor; using UnityEngine; [InitializeOnLoad] public static class Example { static Example() { AssetDatabase.cacheServerConnectionChanged += _ => Debug.Log( "ピカチュウ" ); } } 参考サイト様
概要 using UnityEditor; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { AssetDatabase.CloseCacheServerConnection(); } }
概要 Project ウィンドウの「Create」からプレハブを作成できるようになった
概要 C:\android-ndk-r16b\ndk-build.cmd echo "完了" pause ndk-build が完了した後に、完了したことを画面に出力した状態で 処理を止めようと思ったら、ndk-build 完了直後に 自動でコマンドプロンプトが終了してしまった call C:\android-ndk-r16b\ndk-bu…
概要 エディター用スクリプトは、EditorGUIUtility.Load 関数を使用して要求に応じて読み込まれるアセットファイルを使用します。この関数は、Editor Default Resources と呼ばれるフォルダー内のアセットファイルを検索します。 Editor Default Resources …
概要 using UnityEngine; public class Example : MonoBehaviour { private void Update() { Debug.Log( Vector3Int.forward ); // (0, 0, 1) Debug.Log( Vector3Int.back ); // (0, 0, -1) } }
概要 using UnityEngine; public class Example : MonoBehaviour { private void Update() { Debug.Log( Time.timeAsDouble ); Debug.Log( Time.timeSinceLevelLoadAsDouble ); Debug.Log( Time.fixedTimeAsDouble ); Debug.Log( Time.unscaledTimeAsDouble …
概要 using UnityEditor; using UnityEngine; public class Example : EditorWindow { [MenuItem( "Tools/Hoge" )] private static void Open() { var window = GetWindow<Example>(); window.saveChangesMessage = "変更があります。保存しますか?"; } private void</example>…
概要 プレハブモードの時は Scene ビューに「Auto Save」のチェックボックスが表示されますが Project Settings の「Editor > Prefab Mode > Allow Auto Save」をオフにすることで 「Auto Save」のチェックボックスを非表示にして Auto Save を無効化できる…
概要 代わりに UnityWebRequest.result を使用します using System; using System.Collections; using UnityEngine; using UnityEngine.Networking; public class Example : MonoBehaviour { private IEnumerator Start() { var request = UnityWebRequest.G…
リポジトリ 使い方 シーンに存在するゲームオブジェクトに「SpriteAtlasReferencer」します これで、シーンを保存した時にそのシーンが使用しているすべての SpriteAtlas の参照が 「SpriteAtlasReferencer」に自動で保持されるようになります シーンをアセ…
リポジトリ 使用例 通常 using UnityEngine; public class Example : MonoBehaviour { private void Awake() { var name = "ピカチュウ"; var result = name.Replace( "ピカチュウ", "カイリュー" ); Debug.Log( result ); // カイリュー } } UniStringRepla…