Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public static void CacheTextures()
        {
            if (!texturesCached)
            {
                contract        = UAliveIcons.SetWhenNull("Contract", UAliveIcons.IconFromPath("contract", UAliveIcons.IconSize.Large));
                scope           = UAliveIcons.SetWhenNull("Scope", UAliveIcons.IconFromPath("scope", UAliveIcons.IconSize.Large));
                variable        = UAliveIcons.SetWhenNull("Variable", UAliveIcons.IconFromPathBoltFlowUnitCategories("Variables", UAliveIcons.IconSize.Medium));
                method          = UAliveIcons.SetWhenNull("Method", UAliveIcons.IconFromPathBoltFlow("Ludiq.Bolt.Flow", UAliveIcons.IconSize.Medium));
                @class          = UAliveIcons.SetWhenNull("ClassKind", UAliveIcons.IconFromPath("class", UAliveIcons.IconSize.Medium));
                @struct         = UAliveIcons.SetWhenNull("StructKind", UAliveIcons.IconFromPath("struct", UAliveIcons.IconSize.Medium));
                @interface      = UAliveIcons.SetWhenNull("InterfaceKind", UAliveIcons.IconFromPath("interface", UAliveIcons.IconSize.Medium));
                @enum           = UAliveIcons.SetWhenNull("EnumKind", UAliveIcons.IconFromPath("enum", UAliveIcons.IconSize.Medium));
                @event          = UAliveIcons.SetWhenNull("EventKind", UAliveIcons.IconFromPath("event", UAliveIcons.IconSize.Medium));
                properties      = UAliveIcons.SetWhenNull("Properties", UAliveIcons.IconFromPath("properties", UAliveIcons.IconSize.Medium));
                arrowRightWhite = UAliveIcons.SetWhenNull("ArrowRightWhite", UAliveIcons.IconFromPath("whitearrow_right", UAliveIcons.IconSize.Medium));
                arrowDownWhite  = UAliveIcons.SetWhenNull("ArrowDownWhite", UAliveIcons.IconFromPath("whitearrow_down", UAliveIcons.IconSize.Medium));
                arrowRightDark  = UAliveIcons.SetWhenNull("ArrowRightDark", UAliveIcons.IconFromPath("darkarrow_right", UAliveIcons.IconSize.Medium));
                arrowDownDark   = UAliveIcons.SetWhenNull("ArrowDownDark", UAliveIcons.IconFromPath("darkarrow_down", UAliveIcons.IconSize.Medium));
                arrowUpBlack    = UAliveIcons.SetWhenNull("ArrowUpBlack", UAliveIcons.IconFromPath("blackarrow_up", UAliveIcons.IconSize.Medium));
                arrowDownBlack  = UAliveIcons.SetWhenNull("ArrowDownBlack", UAliveIcons.IconFromPath("blackarrow_down", UAliveIcons.IconSize.Medium));
                addBlack        = UAliveIcons.SetWhenNull("AddBlack", UAliveIcons.IconFromPath("black_add", UAliveIcons.IconSize.Medium));
                removeBlack     = UAliveIcons.SetWhenNull("RemoveBlack", UAliveIcons.IconFromPath("black_remove", UAliveIcons.IconSize.Medium));
                warning         = UAliveIcons.SetWhenNull("Warning", UAliveIcons.IconFromPath("warning", UAliveIcons.IconSize.Large));
                okay            = UAliveIcons.SetWhenNull("Okay", UAliveIcons.IconFromPath("okay", UAliveIcons.IconSize.Large));

                // UNITS
                returnUnit             = UAliveIcons.SetWhenNull("ReturnUnit", UAliveIcons.IconFromPath("return_unit", UAliveIcons.IconSize.Large));
                processorDirectiveUnit = UAliveIcons.SetWhenNull("ProcessorDirectiveUnit", UAliveIcons.IconFromPath("processor_directive_unit", UAliveIcons.IconSize.Large));
                asUnit          = UAliveIcons.SetWhenNull("AsUnit", UAliveIcons.IconFromPath("as_unit", UAliveIcons.IconSize.Large));
                isUnit          = UAliveIcons.SetWhenNull("IsUnit", UAliveIcons.IconFromPath("is_unit", UAliveIcons.IconSize.Large));
                doUnit          = UAliveIcons.SetWhenNull("DoUnit", UAliveIcons.IconFromPath("do_unit", UAliveIcons.IconSize.Large));
                continueUnit    = UAliveIcons.SetWhenNull("ContinueUnit", UAliveIcons.IconFromPath("continue_unit", UAliveIcons.IconSize.Large));
                gotoUnit        = UAliveIcons.SetWhenNull("GotoUnit", UAliveIcons.IconFromPath("goto_unit", UAliveIcons.IconSize.Large));
                labelUnit       = UAliveIcons.SetWhenNull("LabelUnit", UAliveIcons.IconFromPath("label_unit", UAliveIcons.IconSize.Large));
                lockUnit        = UAliveIcons.SetWhenNull("LockUnit", UAliveIcons.IconFromPath("lock_unit", UAliveIcons.IconSize.Large));
                constructorUnit = UAliveIcons.SetWhenNull("ConstructorUnit", UAliveIcons.IconFromPath("constructor_unit", UAliveIcons.IconSize.Large));
                getterUnit      = UAliveIcons.SetWhenNull("GetterUnit", UAliveIcons.IconFromPath("getter_unit", UAliveIcons.IconSize.Large));
                setterUnit      = UAliveIcons.SetWhenNull("SetterUnit", UAliveIcons.IconFromPath("setter_unit", UAliveIcons.IconSize.Large));

                texturesCached = true;
            }
        }
Exemplo n.º 3
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);
        }