2020-03-04から1日間の記事一覧
概要 Canvas Renderer の赤枠のアイコンを押して Select Preset ウィンドウで「Save current to...」ボタンを押して ダイアログが表示されたらプリセットを保存するフォルダと ファイル名を設定して「保存」を押して Project ビューで作成されたプリセットを…
概要 例えば uGUI の Image の Raycast Target をデフォルトでオフにしたい場合は Image コンポーネントの赤枠のアイコンを押して Select Preset ウィンドウで「Save current to...」ボタンを押して New Preset ダイアログで保存するフォルダとファイル名を…
概要 using UnityEngine; public class Example : MonoBehaviour { private void Update() { Log( "ピカチュウ" ); } #if DISABLE_DEBUG_LOG [System.Diagnostics.Conditional( "DUMMY" )] #endif private void Log( string message ) { Debug.Log( message …
スクリプト 使用例 using UnityEngine; public class Example : MonoBehaviour { private readonly CustomLogger m_logger = CustomLogger.Create( "タイトル" ); private void Awake() { m_logger.Log( "Log" ); m_logger.Log( "Log", gameObject ); m_logg…
ソースコード 使用例 通常 using UnityEngine; using UnityEngine.Profiling; public class Example : MonoBehaviour { private void Update() { var sampler = CustomSampler.Create( "AAAAA" ); sampler.Begin(); // ... sampler.End(); } } CustomSampler…
リンク
概要 using UnityEngine; public class Example : MonoBehaviour { private void Update() { Physics.autoSimulation = false; Physics2D.autoSimulation = false; } } 物理演算を無効化する場合は 3D の場合は Physics.autoSimulation に false を、 2D の…
概要 using System.IO; using UnityEditor; using UnityEngine; [InitializeOnLoad] public static class Example { private const string PATH = "Library/Example"; static Example() { if ( File.Exists( PATH ) ) { Debug.Log( "2回目以降の起動" ); ret…
概要 using System.Linq; using UnityEditor; [InitializeOnLoad] public static class Example { static Example() { EditorBuildSettings.sceneListChanged += OnChanged; } private static void OnChanged() { var scenes = EditorBuildSettings.scenes; …
概要 using UnityEditor; [InitializeOnLoad] public static class Example { private const BuildTargetGroup DEFAULT_BUILD_TARGET_GROUP = BuildTargetGroup.Standalone; static Example() { EditorApplication.update += OnUpdate; } private static voi…
概要 Fork メニューの「File > Preferences...」から 「Git」タブの「Change the avatar at gravatar.com」のリンクを選択して 表示された上記のサイトでアカウントを作成して アカウント設定の画面にプロフィール画像をアップロードする そして Fork を再起…
概要 using UnityEditor; using UnityEngine; public class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var go = GameObject.Find( "Cube" ); var path = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot( go ); Debug.Log…