https://www.reddit.com/r/csharp/comments/15ha734/best_ui_framework_for_c/
https://www.reddit.com/r/dotnet/comments/sfy85g/cross_platform_gui_frameworks_that_arent_xamlbased/
I don't like xaml ui...
// Difference between Unity Editor IconContent and TrIconContent. | |
// IconContent hash based on name. So, it is used when looking for an image of an icon. | |
// However, TrIconContent hash based on name and tooltip. | |
// So, when you sets the tooltip, TrIconContent must be used. | |
public sealed partial class EditorGUIUtility : GUIUtility | |
{ | |
static Hashtable s_IconGUIContents = new Hashtable(); | |
public static GUIContent TrIconContent(string iconName, string tooltip) | |
{ |
using System; | |
using System.IO; | |
using System.Reflection; | |
using System.Linq; | |
using UnityEngine; | |
using UnityEditor; | |
using System.Collections.Generic; | |
using Object = UnityEngine.Object; | |
namespace UnityEditor |
<NotepadPlus> | |
<UserLang name="HLSL" ext="cginc shader vs fs hlsl ush" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="yes" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00// 01 02 03/* 04*/</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2">0x</Keywords> |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using UnityEditor; | |
using UnityEngine; | |
private static string AssetPrefabsRoot = "Assets"; | |
[MenuItem("GameObject/Prefab/Apply (Unsafe)", false, -2)] |
Dictionary<string, GUIContent> iconMap = new Dictionary<string, GUIContent>(); | |
GUIContent GetIcon(string path) | |
{ | |
string ext = Path.GetExtension(path).ToLower(); | |
if (iconMap.ContainsKey(ext)) | |
return iconMap[ext]; | |
GUIContent icon = null; | |
try | |
{ |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.Linq; | |
[CustomEditor(typeof(AraTrail))] | |
[CanEditMultipleObjects] | |
internal class AraTrailEditor : Editor | |
{ |
internal static class ObjectFieldEx | |
{ | |
private static readonly int s_ObjectFieldHash = "s_ObjectFieldHash".GetHashCode(); | |
internal const float kSingleLineHeight = 18f; | |
private const float kIndentPerLevel = 15; | |
public static Object ObjectField(Object obj, Type objType, params GUILayoutOption[] options) | |
{ | |
Rect r = EditorGUILayout.GetControlRect(true, kSingleLineHeight, options); | |
return ObjectField(r, obj, objType); |
static void DrawWireDist(Vector3 center, float radius) | |
{ | |
#if UNITY_EDITOR | |
var oldColor = UnityEditor.Handles.color; | |
var oldZTest = UnityEditor.Handles.zTest; | |
UnityEditor.Handles.zTest = UnityEngine.Rendering.CompareFunction.Greater; | |
UnityEditor.Handles.color = new Color(Gizmos.color.r, Gizmos.color.g, Gizmos.color.b, 0.25f); | |
UnityEditor.Handles.DrawWireDisc(center, Vector3.up, radius); | |
UnityEditor.Handles.zTest = UnityEngine.Rendering.CompareFunction.LessEqual; |
public static void RepaintInspector(System.Type t) | |
{ | |
Editor[] ed = (Editor[])Resources.FindObjectsOfTypeAll<Editor>(); | |
for (int i = 0; i < ed.Length; i++) | |
{ | |
if (ed[i].target.GetType() == t) | |
{ | |
ed[i].Repaint(); | |
return; | |
} |