2019-04-01から1日間の記事一覧
概要 using UnityEngine; using UnityEngine.Profiling; public class Example : MonoBehaviour { public class Hoge { } public struct Fuga { } private void Start() { var count = 1000000; var samplerA = CustomSampler.Create( "AAAAAAAAAAAAAAAAAAAA…
概要 参考サイト様
概要 参考サイト様
概要 using System; using System.Reflection; public static class DelegateExt { public static int GetLength<T>( string name ) { return GetLength( typeof( T ), name ); } public static int GetLength( this Type self, string name ) { var attrs = Bi</t>…
概要
ソースコード using UnityEngine; public static class GameObjectExt { public static string GetHierarchyPath( this GameObject gameObject ) { var path = gameObject.name; var parent = gameObject.transform.parent; while ( parent != null ) { path…
ソースコード 上記のスクリプトを Unity プロジェクトの 「Editor」フォルダに追加することで使用できます 使い方 using JetBrains.Annotations; using UnityEngine; public class Test : MonoBehaviour { [NotNull] public Sprite m_sprite; } 例えば NotNu…
概要 using UnityEditor; [InitializeOnLoad] public static class Example { static Example() { EditorApplication.playModeStateChanged += OnChange; } private static void OnChange( PlayModeStateChange state ) { if ( state == PlayModeStateChange…