Пример #1
0
        private Rect BaseType(Rect full, Rect previous)
        {
            if ((ObjectKind)kind.value == ObjectKind.Class)
            {
                var genericsHeight = GetGenericArgumentsHeight(GenericBaseTypeConstruct.Base, full.width, 14);
                var baseTypeRect   = previous;
                baseTypeRect.y     += previous.height - 1;
                baseTypeRect.height = genericsHeight + 40 + 9;

                // Draw a rectangle that contains a border and is light grey. Color usage for differentiating sections.
                UtilityGUI.Container(baseTypeRect, Color.black, 0.6f.Grey(), 1, 10, (container) =>
                {
                    UtilityGUI.Container(container, Color.black, 0.8f.Grey(), 1, 4, (_container) =>
                    {
                        var icon = UAliveIcons.SetWhenNull("Type", UAliveIcons.IconFromPathLudiq("System.Type", UAliveIcons.IconSize.Large));

                        UtilityGUI.BorderRect(new Rect(container.x, container.y, container.width, 24), 1, 0.3f.Grey(), Color.black, UtilityGUI.BorderDrawPlacement.Inside);
                        Graphics.DrawTexture(new Rect(container.x + 5, container.y + 4, 16, 16), icon);
                        EditorGUI.LabelField(new Rect(_container.x + 20, _container.y, _container.width - 26, 16), "Base Type", new GUIStyle(EditorStyles.boldLabel)
                        {
                            normal = new GUIStyleState()
                            {
                                textColor = Color.white
                            }
                        });
                        LudiqGUI.Inspector(baseType, new Rect(_container.x + 14, _container.y + 32, _container.width - 20, genericsHeight - 6), GUIContent.none);
                    });
                });

                return(baseTypeRect);
            }

            return(previous);
        }
Пример #2
0
        public static Texture2D FindIcon(this System.Type type)
        {
            var name = type.IsPrimitive ? type.CSharpName(false) : type.CSharpFullName(false);

            var icon = UAliveIcons.IconFromPathLudiq(name, UAliveIcons.IconSize.Medium);

            if (icon != null)
            {
                return(icon);
            }

            icon = UAliveIcons.IconFromPathBoltFlow(name, UAliveIcons.IconSize.Medium);

            if (icon == null)
            {
                return(icon);
            }

            icon = UAliveIcons.IconFromPathBolt(name, UAliveIcons.IconSize.Medium);

            return(icon);
        }