/// <summary>
        /// Called when the window is Enabled.
        /// </summary>
        public void OnEnable()
        {
            layoutProfiles = CinemaMocapLayout.LoadMetaData();
            if (layoutProfiles.Count < 1)
            {
                Debug.LogError(NO_LAYOUT_PROFILES_FOUND_MSG);
                return;
            }

            mocapWorkflowPhase = GetUserDefaultWorkflow();


            if (mocapWorkflowPhase == MocapWorkflow.Record)
            {
                mocapPipeline = new RecordPipeline(true);
            }
            else
            {
                mocapPipeline = new ReviewPipeline(true);
            }

            showInputSettings     = new AnimBool(true, Repaint);
            showMappingSettings   = new AnimBool(true, Repaint);
            showOutputSettings    = new AnimBool(true, Repaint);
            showRecordingSettings = new AnimBool(true, Repaint);

            foldoutStyle = skin.FindStyle("SettingsFoldout");
            if (foldoutStyle == null)
            {
                foldoutStyle = skin.FindStyle("box");
            }
        }
Example #2
0
 public EditorSkinHelper()
 {
     proSkin      = AssetDatabase.LoadAssetAtPath("Assets/Util/GUISkins/DarkSkin.guiskin", typeof(GUISkin)) as GUISkin;
     sectionStyle = proSkin.FindStyle("Section Label");
     groupStyle   = proSkin.FindStyle("Group Label");
     titleStyle   = proSkin.FindStyle("Prop Title");
 }
Example #3
0
    void OnGUI()
    {
        GUIStyle styleplay    = guiSkin.FindStyle("play");
        GUIStyle stylebacplay = guiSkin.FindStyle("backplay");
        GUIStyle stylemenu    = guiSkin.FindStyle("menu");

        GUI.skin = guiSkin;
        float rx = Screen.width / native_width;
        float ry = Screen.height / native_height;

        GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(rx, ry, 1));
        GUI.BeginGroup(new Rect(0, 0, 480, 800));
        GUI.DrawTexture(new Rect(0, 0, 480, 800), backgroundTexture, ScaleMode.StretchToFill, false);

        if (GUI.Button(new Rect(89, 635, 115, 200), "", styleplay))
        {
            Application.LoadLevel("PlayingTheGame");
        }
        if (GUI.Button(new Rect(189, 635, 115, 200), "", stylebacplay))
        {
            Application.LoadLevel("PlayScene");
        }

        if (GUI.Button(new Rect(289, 635, 115, 200), "", stylemenu))
        {
            Application.LoadLevel("MenuPrincipal");
        }

        GUI.EndGroup();
    }
Example #4
0
    void OnGUI()
    {
        //Abre y cierra el inventario o mochila.
        if (botonPack && !referenciaInventario.arrastrando)
        {
            isPack = !isPack;
            audio.PlayOneShot(sound, 0.05f);
        }
        //Abre y cierra la tienda
        if (botonShop && !referenciaInventario.arrastrando)
        {
            isShop = !isShop;
            audio.PlayOneShot(sound, 0.05f);
        }

        GUI.depth = 150;
        //Boton de backpack

        botonPack = GUI.Button(new Rect(Screen.width * 0.0025f,    //Camera.main.WorldToScreenPoint(this.transform.position).x,
                                        Screen.height - tamanoBotones.y,
                                        tamanoBotones.x, tamanoBotones.y), "",
                               skinMenuInferior.FindStyle("MenuInferiorStyle"));

        botonShop = GUI.Button(new Rect(Screen.width - tamanoBotones.x, Screen.height - tamanoBotones.y,
                                        tamanoBotones.x, tamanoBotones.y),
                               "", skinMenuInferior.FindStyle("BotonShop"));
    }
Example #5
0
    void OnGUI()
    {
        GUIStyle stylelabelgallery = guiSkin.FindStyle("labelgallery");
        GUIStyle stylelabelb1      = guiSkin.FindStyle("btnleft");
        GUIStyle stylelabelb2      = guiSkin.FindStyle("btnright");

        GUI.skin = guiSkin;
        float rx = Screen.width / native_width;
        float ry = Screen.height / native_height;

        GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(rx, ry, 1));
        GUI.BeginGroup(new Rect(0, 0, 480, 800));

        GUI.Label(new Rect(0, 0, 480, 800), "", stylelabelgallery);
        GUI.Button(new Rect(-20, 375, 130, 80), "", stylelabelb1);
        GUI.Button(new Rect(380, 375, 130, 80), "", stylelabelb2);

        if (GUI.Button(new Rect(175, 718, 130, 80), "BACK"))
        {
            Application.LoadLevel("OptionScene");
        }
        //GUI.Button (new Rect (240, 760, 34, 34), "",styleyoutube);

        GUI.EndGroup();
    }
    public override void OnEnable()
    {
        base.OnEnable();

        // Find to location of the TextMesh Pro Asset Folder (as users may have moved it)
        string tmproAssetFolderPath = TMPro_EditorUtility.GetAssetLocation();

        // Initialized instance of Material Editor State Manager
        if (EditorGUIUtility.isProSkin)
        {
            mySkin = AssetDatabase.LoadAssetAtPath(tmproAssetFolderPath + "/GUISkins/TMPro_DarkSkin.guiskin", typeof(GUISkin)) as GUISkin;
        }
        else
        {
            mySkin = AssetDatabase.LoadAssetAtPath(tmproAssetFolderPath + "/GUISkins/TMPro_LightSkin.guiskin", typeof(GUISkin)) as GUISkin;
        }

        if (mySkin != null)
        {
            Group_Label      = mySkin.FindStyle("Group Label");
            Group_Label_Left = mySkin.FindStyle("Group Label - Left Half");
        }



        // Initialize the Event Listener for Undo Events.
        Undo.undoRedoPerformed        += OnUndoRedo;
        Undo.postprocessModifications += OnUndoRedoEvent;
    }
        // -- //

        void LoadSkin()
        {
            skin = Resources.Load("Events/skin") as GUISkin;

            normalEventStyle = skin.FindStyle("NormalEvent");
            pokedEventStyle  = skin.FindStyle("PokedEvent");
        }
Example #8
0
        private void drawProduct(ProductInfo product)
        {
            EditorGUILayout.BeginVertical(skin.FindStyle("Header"));
            Rect foldoutRect = EditorGUILayout.GetControlRect();

            product.ShowProductInfo.target = EditorGUI.Foldout(foldoutRect, product.ShowProductInfo.target, product.name, true);
            EditorGUILayout.EndVertical();

#if UNITY_5
            using (var productGroup = new EditorGUILayout.FadeGroupScope(product.ShowProductInfo.faded))
            {
                if (productGroup.visible)
                {
#else
            {
                if (product.ShowProductInfo.target)
                {
#endif

                    Rect contentRect = EditorGUILayout.BeginVertical(skin.FindStyle("Content"));
                    product.OnGUI(contentRect);
                    EditorGUILayout.EndVertical();
                }
            }
        }
 public static void Draw(Vector3Property property, GUISkin skin, float minimumValue, float maximumValue)
 {
     using (new GUILayout.HorizontalScope(skin.FindStyle("Property")))
     {
         property.SetRandomized(
             ToggleButtonDrawer.Draw(
                 new GUIContent(skin.FindStyle("RandomManualIcons").hover.background),
                 new GUIContent(skin.FindStyle("RandomManualIcons").normal.background),
                 "This property is set to manual.",
                 "This property is set to random.",
                 skin.FindStyle("ToggleButton"),
                 property.Randomized));
         if (property.Randomized)
         {
             using (new GUILayout.HorizontalScope(skin.FindStyle("FieldValue")))
             {
                 EditorGUILayout.LabelField(property.Name, skin.label);
                 property.SetMinMax(
                     FloatValueDrawer.Draw(
                         new GUIContent("Min"), property.Min, minimumValue, property.Max, skin, true),
                     FloatValueDrawer.Draw(
                         new GUIContent("Max"), property.Max, property.Min, maximumValue, skin, true));
             }
         }
         else
         {
             property.SetValue(
                 Vector3ValueDrawer.Draw(new GUIContent(property.Name),
                                         property.Value, skin));
         }
     }
 }
Example #10
0
    /// <summary>
    /// TreeViewControl overrides for our custom logos
    /// </summary>

    public override void AssignDefaults()
    {
        base.AssignDefaults();
        string tempWwisePath = "Assets/Wwise/Editor/WwiseWindows/TreeViewControl/";

        m_textureWwiseAuxBusIcon         = GetTexture(tempWwisePath + "auxbus_nor.png");
        m_textureWwiseBusIcon            = GetTexture(tempWwisePath + "bus_nor.png");
        m_textureWwiseEventIcon          = GetTexture(tempWwisePath + "event_nor.png");
        m_textureWwiseFolderIcon         = GetTexture(tempWwisePath + "folder_nor.png");
        m_textureWwisePhysicalFolderIcon = GetTexture(tempWwisePath + "physical_folder_nor.png");
        m_textureWwiseProjectIcon        = GetTexture(tempWwisePath + "wproj.png");
        m_textureWwiseSoundbankIcon      = GetTexture(tempWwisePath + "soundbank_nor.png");
        m_textureWwiseStateIcon          = GetTexture(tempWwisePath + "state_nor.png");
        m_textureWwiseStateGroupIcon     = GetTexture(tempWwisePath + "stategroup_nor.png");
        m_textureWwiseSwitchIcon         = GetTexture(tempWwisePath + "switch_nor.png");
        m_textureWwiseSwitchGroupIcon    = GetTexture(tempWwisePath + "switchgroup_nor.png");
        m_textureWwiseWorkUnitIcon       = GetTexture(tempWwisePath + "workunit_nor.png");

        if (m_filterBoxStyle == null)
        {
            GUISkin InspectorSkin = ScriptableObject.Instantiate(EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector)) as GUISkin;
            InspectorSkin.hideFlags      = HideFlags.HideAndDontSave;
            m_filterBoxStyle             = InspectorSkin.FindStyle("SearchTextField");
            m_filterBoxCancelButtonStyle = InspectorSkin.FindStyle("SearchCancelButton");
        }
    }
Example #11
0
    public static void Init()
    {
#if (UNITY_3_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4)
        if (isProSkin != tk2dPreferences.inst.isProSkin)
        {
            skin      = null;
            isProSkin = tk2dPreferences.inst.isProSkin;
        }
#else
        if (isProSkin != EditorGUIUtility.isProSkin)
        {
            skin      = null;
            isProSkin = EditorGUIUtility.isProSkin;
        }
#endif

        if (skin == null)
        {
            skin = AssetDatabase.LoadAssetAtPath(GetSkinPath(), typeof(GUISkin)) as GUISkin;
            if (skin != null)
            {
                sc_inspectorBG          = skin.FindStyle("SC_InspectorBG");
                sc_inspectorHeaderBG    = skin.FindStyle("SC_InspectorHeaderBG");
                sc_listBoxBG            = skin.FindStyle("SC_ListBoxBG");
                sc_listBoxItem          = skin.FindStyle("SC_ListBoxItem");
                sc_listBoxSectionHeader = skin.FindStyle("SC_ListBoxSectionHeader");
                sc_bodyBackground       = skin.FindStyle("SC_BodyBackground");
                sc_dropBox = skin.FindStyle("SC_DropBox");

                toolbarSearch         = skin.FindStyle("ToolbarSearch");
                toolbarSearchClear    = skin.FindStyle("ToolbarSearchClear");
                toolbarSearchRightCap = skin.FindStyle("ToolbarSearchRightCap");
            }
        }
    }
Example #12
0
    static CUListControl()
    {
        GUISkin skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector);

        titleStyle          = skin.FindStyle("OL Title");
        scrollViewStyle     = skin.FindStyle("OL box");
        defaultItemRenderer = new CUDefaultItemRenderer <object>();
    }
Example #13
0
 void Start()
 {
     _pos = _position;
     if (_GUISkin)
     {
         _style = _GUISkin.FindStyle("popup") ?? _GUISkin.FindStyle("textArea");
     }
 }
Example #14
0
        public void OnEnable()
        {
            // Initialize the Event Listener for Undo Events.
            Undo.undoRedoPerformed += OnUndoRedo;
            //Undo.postprocessModifications += OnUndoRedoEvent;

            text_prop      = serializedObject.FindProperty("m_text");
            fontAsset_prop = serializedObject.FindProperty("m_fontAsset");

            fontSize_prop           = serializedObject.FindProperty("m_fontSize");
            fontColor_prop          = serializedObject.FindProperty("m_fontColor");
            characterSpacing_prop   = serializedObject.FindProperty("m_characterSpacing");
            lineLength_prop         = serializedObject.FindProperty("m_lineLength");
            lineSpacing_prop        = serializedObject.FindProperty("m_lineSpacing");
            lineJustification_prop  = serializedObject.FindProperty("m_lineJustification");
            anchorPosition_prop     = serializedObject.FindProperty("m_anchor");
            horizontalMapping_prop  = serializedObject.FindProperty("m_horizontalMapping");
            verticalMapping_prop    = serializedObject.FindProperty("m_verticalMapping");
            enableKerning_prop      = serializedObject.FindProperty("m_enableKerning");
            overrideHtmlColor_prop  = serializedObject.FindProperty("m_overrideHtmlColors");
            enableWordWrapping_prop = serializedObject.FindProperty("m_enableWordWrapping");
            wordWrappingRatios_prop = serializedObject.FindProperty("m_wordWrappingRatios");

            havePropertiesChanged_prop   = serializedObject.FindProperty("havePropertiesChanged");
            inputSource_prop             = serializedObject.FindProperty("m_inputSource");
            isInputPasingRequired_prop   = serializedObject.FindProperty("isInputParsingRequired");
            isAffectingWordWrapping_prop = serializedObject.FindProperty("isAffectingWordWrapping");
            enableExtraPadding_prop      = serializedObject.FindProperty("m_enableExtraPadding");
            checkPaddingRequired_prop    = serializedObject.FindProperty("checkPaddingRequired");

            sortingLayerID_prop = serializedObject.FindProperty("m_sortingLayerID");
            sortingOrder_prop   = serializedObject.FindProperty("m_sortingOrder");

            hasFontAssetChanged_prop = serializedObject.FindProperty("hasFontAssetChanged");


            if (EditorGUIUtility.isProSkin)
            {
                mySkin = AssetDatabase.LoadAssetAtPath("Assets/TextMesh Pro/GUISkins/TMPro_DarkSkin.guiskin", typeof(GUISkin)) as GUISkin;
            }
            else
            {
                mySkin = AssetDatabase.LoadAssetAtPath("Assets/TextMesh Pro/GUISkins/TMPro_LightSkin.guiskin", typeof(GUISkin)) as GUISkin;
            }

            if (mySkin != null)
            {
                Section_Label = mySkin.FindStyle("Section Label");
                //Group_Label = mySkin.FindStyle("Group Label");
                textAreaBox = mySkin.FindStyle("Text Area Box (Editor)");
            }

            m_textMeshProScript = (TextMeshPro)target;
            m_transform         = Selection.activeGameObject.transform;
            m_renderer          = Selection.activeGameObject.GetComponent <Renderer>();

            //m_updateManager = Camera.main.gameObject.GetComponent<TMPro_UpdateManager>();
        }
Example #15
0
 private static void UpdateStyles(GUISkin skin)
 {
     if (SearchFieldStyle == null)
     {
         SearchFieldStyle  = skin.FindStyle("ToolbarSeachTextField");
         SearchCancelStyle = skin.FindStyle("ToolbarSeachCancelButton");
         ToolbarStyle      = skin.FindStyle("Toolbar");
     }
 }
Example #16
0
 private void Awake()
 {
     editorSkin       = AssetDatabase.LoadAssetAtPath <GUISkin>("Assets/Scripts/Application/BlockTerrain/MapEditorSkin.guiskin");
     layerStyle       = editorSkin.toggle;
     gridStyle        = editorSkin.FindStyle("grid");
     titleStyle       = editorSkin.FindStyle("title");
     titleActiveStyle = editorSkin.FindStyle("titleActive");
     prefabIcon       = EditorGUIUtility.FindTexture("PrefabNormal Icon");
     this.LoadEditorConfig();
 }
Example #17
0
 static SearchUtils()
 {
     if (skin == null)
     {
         skin    = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector);
         toolbar = skin.FindStyle("Toolbar");
         search  = skin.FindStyle("ToolbarSeachTextField");
         //button = skin.FindStyle("ToolbarButton");
         cancelButton = skin.FindStyle("ToolbarSeachCancelButton");
     }
 }
Example #18
0
        public static GridPivot PivotPointSelector(GridPivot pivot)
        {
            GUISkin skin = AstarPathEditor.astarSkin;

            GUIStyle background = skin.FindStyle("GridPivotSelectBackground");

            Rect r = GUILayoutUtility.GetRect(19, 19, background);

        #if !UNITY_LE_4_3
            // I have no idea... but it is required for it to work well
            r.y -= 14;
        #endif

            r.width  = 19;
            r.height = 19;

            if (background == null)
            {
                return(pivot);
            }

            if (Event.current.type == EventType.Repaint)
            {
                background.Draw(r, false, false, false, false);
            }

            if (GUI.Toggle(new Rect(r.x, r.y, 7, 7), pivot == GridPivot.TopLeft, "", skin.FindStyle("GridPivotSelectButton")))
            {
                pivot = GridPivot.TopLeft;
            }

            if (GUI.Toggle(new Rect(r.x + 12, r.y, 7, 7), pivot == GridPivot.TopRight, "", skin.FindStyle("GridPivotSelectButton")))
            {
                pivot = GridPivot.TopRight;
            }

            if (GUI.Toggle(new Rect(r.x + 12, r.y + 12, 7, 7), pivot == GridPivot.BottomRight, "", skin.FindStyle("GridPivotSelectButton")))
            {
                pivot = GridPivot.BottomRight;
            }

            if (GUI.Toggle(new Rect(r.x, r.y + 12, 7, 7), pivot == GridPivot.BottomLeft, "", skin.FindStyle("GridPivotSelectButton")))
            {
                pivot = GridPivot.BottomLeft;
            }

            if (GUI.Toggle(new Rect(r.x + 6, r.y + 6, 7, 7), pivot == GridPivot.Center, "", skin.FindStyle("GridPivotSelectButton")))
            {
                pivot = GridPivot.Center;
            }

            return(pivot);
        }
    public void setProps(Rect itemRect, int padding, GUISkin skin)
    {
        if (styleName == "")
        {
            _style = GUIStyle.none;
        }
        else
        {
            _style = skin.FindStyle(styleName);
        }
        if (_style == null)
        {
            _style = GUIStyle.none;
        }

        if (textStyleName == "")
        {
            _textStyle = GUIStyle.none;
        }
        else
        {
            _textStyle = skin.FindStyle(textStyleName);
        }
        if (_textStyle == null)
        {
            _textStyle = GUIStyle.none;
        }

        _itemRect = itemRect;



        int middleY = (int)(_itemRect.y + _itemRect.height / 2);

        if (contentSize.y < itemRect.height)
        {
            int padd = (int)((itemRect.height - contentSize.y) / 2);
            _contentRect    = new Rect(0, _itemRect.y + padding, contentSize.x, contentSize.y);
            _textRect       = new Rect(_contentRect.width + padding, _itemRect.y, 0, _itemRect.height);
            _textRect.width = _itemRect.width - _textRect.x;
        }
        else
        {
            int width = (int)((float)itemRect.height / (float)contentSize.y * (float)contentSize.x);
            _contentRect = new Rect(0, _itemRect.y, width, itemRect.height);
            _textRect    = new Rect(_contentRect.width + padding, _itemRect.y, itemRect.width - _contentRect.width - padding, itemRect.height);
        }
        _textRect.width  -= textOffset.horizontal;
        _textRect.height -= textOffset.vertical;
        _textRect.x      += textOffset.left;
        _textRect.y      += textOffset.top;
    }
    public CUListStyle()
    {
        GUISkin skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector);

        evenBackground = new GUIStyle(skin.FindStyle("OL EntryBackEven"));
        oddBackground  = new GUIStyle(skin.FindStyle("OL EntryBackOdd"));
        // default style doesn't handle focus. therefore we have to swap the textures
        evenBackground.onFocused.background = evenBackground.onNormal.background;
        oddBackground.onFocused.background  = oddBackground.onNormal.background;
        Texture2D texture;

        if (EditorGUIUtility.isProSkin)
        {
            texture = LoadTexture("CUNotFocusedSelectionDark.png");
        }
        else
        {
            texture = LoadTexture("CUNotFocusedSelectionLight.png");
        }
        evenBackground.onNormal.background = texture;
        oddBackground.onNormal.background  = texture;

        item             = new GUIStyle(skin.FindStyle("PlayerSettingsPlatform"));
        item.alignment   = TextAnchor.MiddleLeft;
        item.fixedHeight = 0;
        item.padding     = new RectOffset(5, 0, 0, 0);
        item.margin      = new RectOffset();

        dropIntoHighlight = new GUIStyle();
        dropIntoHighlight.normal.background = LoadTexture("CUDragIntoHighlight.png");
        dropIntoHighlight.border            = new RectOffset(3, 3, 3, 3);
        dropIntoHighlight.stretchWidth      = true;
        dropIntoHighlight.stretchHeight     = true;
        dropIntoHighlight.imagePosition     = ImagePosition.ImageOnly;

        dropBeforeHighlight = new GUIStyle();
        dropBeforeHighlight.normal.background = LoadTexture("CUDragBeforeHighlight.png");
        dropBeforeHighlight.border            = new RectOffset(0, 0, 3, 0);
        dropBeforeHighlight.stretchWidth      = true;
        dropBeforeHighlight.stretchHeight     = true;
        dropBeforeHighlight.overflow          = new RectOffset(0, 0, 1, 0);
        dropBeforeHighlight.imagePosition     = ImagePosition.ImageOnly;

        dropAfterHighlight = new GUIStyle();
        dropAfterHighlight.normal.background = LoadTexture("CUDragAfterHighlight.png");
        dropAfterHighlight.border            = new RectOffset(0, 0, 0, 3);
        dropAfterHighlight.stretchWidth      = true;
        dropAfterHighlight.stretchHeight     = true;
        dropAfterHighlight.overflow          = new RectOffset(0, 0, 0, 1);
        dropAfterHighlight.imagePosition     = ImagePosition.ImageOnly;
    }
Example #21
0
    void showTooltip()
    {
        if (GUI.tooltip.Equals(""))
        {
            return;
        }

        float    mouseX   = Input.mousePosition.x;
        float    mouseY   = Screen.height - Input.mousePosition.y;
        GUIStyle style    = skin.GetStyle("tooltip");
        float    height   = style.CalcHeight(new GUIContent(GUI.tooltip), 190f);
        float    maxWidth = 0;
        float    minWidth = 0;

        style.CalcMinMaxWidth(new GUIContent(GUI.tooltip), out minWidth,
                              out maxWidth);
        float yOffset = 0;
        float xOffset = 0;

        if (mouseY + height > Screen.height)
        {
            yOffset = mouseY + height - Screen.height;
        }
        if (mouseX + 210 > Screen.width)
        {
            xOffset = 220;
        }

        if (mouseX + maxWidth + 18 > Screen.width)
        {
            xOffset = maxWidth + 31;
        }
        else
        {
            xOffset = 0;
        }
        int    nameLength  = GUI.tooltip.IndexOf('\n');
        string itemName    = GUI.tooltip.Substring(0, nameLength);
        string description = GUI.tooltip.Replace(itemName + '\n', "");

        GUI.Box(new Rect(mouseX + 11 - xOffset, mouseY - yOffset - 7,
                         maxWidth + 18, height + 14), "");
        GUI.Label(new Rect(mouseX + 20 - xOffset, mouseY - yOffset,
                           160, 23), itemName, "tooltip");
        skin.FindStyle("tooltip").normal.textColor = Color.yellow;
        GUI.Label(new Rect(mouseX + 20 - xOffset, mouseY + 17 - yOffset,
                           160, height - 23), description, "tooltip");
        skin.FindStyle("tooltip").normal.textColor = new Color(203f / 255f,
                                                               220f / 255f, 220f / 255f);
    }
        void LoadStyles()
        {
            PWGUISkin = Resources.Load <GUISkin>("PWEditorSkin");

            selectionStyle = PWGUISkin.FindStyle("Selection");

            nodeStyle         = PWGUISkin.FindStyle("Node");
            nodeSelectedStyle = PWGUISkin.FindStyle("NodeSelected");
            nodeHeaderStyle   = PWGUISkin.FindStyle("NodeHeader");

            GUI.skin = PWGUISkin;

            styleLoaded = true;
        }
 public void setTopLeftPosition(int left, int top, GUISkin skin)
 {
     config.activeColorStyle = skin.FindStyle(config.activeColorStyleName);
     config.left             = left;
     config.top = top;
     recalculatePositions();
 }
        public static int Draw(GUIContent label, int value, GUISkin skin, bool asPrefix, float prefixWidth, bool spaceAfterValue)
        {
            int _fieldvalue = 0;

            using (new GUILayout.HorizontalScope(skin.FindStyle("FieldValue")))
            {
                if (!asPrefix)
                {
                    EditorGUILayout.LabelField(label, skin.label);
                    _fieldvalue = EditorGUILayout.IntField(" ", value, skin.GetStyle("floatField"), GUILayout.MinWidth(50));
                }
                else
                {
                    float baseWidth = EditorGUIUtility.labelWidth;
                    EditorGUIUtility.labelWidth = prefixWidth;
                    _fieldvalue = EditorGUILayout.IntField(label, value, skin.GetStyle("floatField"), GUILayout.MinWidth(50));
                    EditorGUIUtility.labelWidth = baseWidth;
                }
                if (spaceAfterValue)
                {
                    GUILayout.FlexibleSpace();
                }
            }
            return(_fieldvalue);
        }
    void recalculatePositions()
    {
        GUIStyle verticalScrollBar = currentSkin.FindStyle("verticalScrollbar");
        int      scrollWidth       = (int)(verticalScrollBar.fixedWidth + verticalScrollBar.margin.left + verticalScrollBar.margin.right);


        int areaHeight = config.picButtonHeight * config.picRowNumber
                         + config.picButtonMargin * (config.picRowNumber - 1)
                         + config.scrollAreaPadding * 2;
        int areaWidth = config.picButtonWidth * config.picColumnNumber
                        + config.picButtonMargin * (config.picColumnNumber - 1)
                        + scrollWidth
                        + config.scrollAreaPadding * 2;

        int areaTop = config.iconButtonHeight + config.iconButtonMargin;

        windowRect.width  = areaWidth;
        windowRect.height = areaHeight + areaTop;
        windowRect.x      = config.centerX - windowRect.width / 2;
        windowRect.y      = config.centerY - windowRect.height / 2;

        scrollAreaRect = new Rect(0, areaTop, areaWidth, areaHeight);

        recalculateIconPositions();
        recalculatePictureButtonPositions();
    }
        void OnEnable()
        {
            // Find to location of the TextMesh Pro Asset Folder (as users may have moved it)
            string tmproAssetFolderPath = TMPro_EditorUtility.GetAssetLocation();

            // Get all serialized properties
            prop_isEnabled         = serializedObject.FindProperty("m_isEnabled");
            prop_propertiesChanged = serializedObject.FindProperty("propertiesChanged");

            // Get the appropriate skin based on Dark or Light Unity Skin.
            if (EditorGUIUtility.isProSkin)
            {
                mySkin = AssetDatabase.LoadAssetAtPath(tmproAssetFolderPath + "/GUISkins/TMPro_DarkSkin.guiskin", typeof(GUISkin)) as GUISkin;
            }
            else
            {
                mySkin = AssetDatabase.LoadAssetAtPath(tmproAssetFolderPath + "/GUISkins/TMPro_LightSkin.guiskin", typeof(GUISkin)) as GUISkin;
            }

            if (mySkin != null)
            {
                fieldLabel = mySkin.FindStyle("Section Label");
                //textAreaBox = mySkin.FindStyle("Text Area Box (Editor)");
            }
        }
Example #27
0
    void OnGUI()
    {
        GUI.skin = skin;

        Rect windowBox = GUIUtilities.getRect(Screen.width * 0.6f, Screen.height * 0.9f);

        GUI.Box(windowBox, "Welcome to Enlightened!");

        float margin  = windowBox.height * 0.07f;
        Rect  textBox = new Rect(windowBox.x + margin, windowBox.y + 60, windowBox.width - (margin * 2), windowBox.height * 0.75f);

        float height    = skin.FindStyle("Label").CalcHeight(new GUIContent(text), textBox.width - 20);
        Rect  insideBox = new Rect(0, 0, textBox.width - 20, height);

        scrollPosition = GUI.BeginScrollView(textBox, scrollPosition, insideBox);
        GUI.Label(insideBox, text);
        GUI.EndScrollView();

        float buttonHeight = 40;
        float buttonYBase  = windowBox.y + windowBox.height - buttonHeight;

        if (GUI.Button(new Rect((Screen.width / 2.0f) - 50, buttonYBase - (windowBox.height * 0.05f), 100, buttonHeight), "Okay"))
        {
            if (ScreenBlocker.instance != null)
            {
                ScreenBlocker.instance.setBlocking(false);
            }
            enabled = false;
        }
    }
 public override void Render(GUISkin skin)
 {
     using (var scope = new EditorGUILayout.VerticalScope(EditorStyles.textArea))
     {
         EditorGUILayout.LabelField(m_code, skin.FindStyle("code")); //, GUILayout.Height(m_code.Split('\n').Length * EditorGUIUtility.singleLineHeight)
     }
 }
    void OnGUI()
    {
        GUIStyle stylefacebook = guiSkin.FindStyle("up");

        GUI.skin = guiSkin;
        float rx = Screen.width / native_width;
        float ry = Screen.height / native_height;

        GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(rx, ry, 1));
        GUI.BeginGroup(new Rect(0, 0, 480, 800));

        GUI.Label(new Rect(0, -20, 480, 800), "", stylefacebook);

        if (GUI.Button(new Rect(52, 718, 130, 80), "BACK"))
        {
            Application.LoadLevel("MainMenu");
        }

        if (GUI.Button(new Rect(310, 718, 90, 80), "GO"))
        {
            Application.LoadLevel("");
        }
        //GUI.Button (new Rect (240, 760, 34, 34), "",styleyoutube);

        GUI.EndGroup();
    }
    public void setProperties(int left, int top, int contentWidth, int contentHeight, int margin, GUISkin skin)
    {
        propSingleton      = PropertiesSingleton.instance;
        canvas             = propSingleton.canvasWorkspaceController.canvas;
        this.left          = left;
        this.top           = top;
        this.margin        = margin;
        this.contentWidth  = contentWidth;
        this.contentHeight = contentHeight;


        horizontalScrollHeight = (int)skin.FindStyle("horizontalscrollbar").fixedHeight;


        verticalScrollWidth = (int)skin.FindStyle("verticalscrollbar").fixedWidth;
        recalculatePositions();
    }