예제 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void DrawLinkIcon(Object pSelf, ISettingsController pControl, Rect pPropertyRect)
        {
            bool isSelf = ((pControl as Object) == pSelf);

            Rect iconRect = pPropertyRect;

            iconRect.x     -= 26;
            iconRect.y     += 1;
            iconRect.width  = 40;
            iconRect.height = 16;

            GUIContent labelContent = new GUIContent();

            labelContent.image   = ControlIconTex;
            labelContent.tooltip = "Controlled by " + (isSelf ? "this component" :
                                                       pControl.GetType().Name + " in \"" + pControl.name + "\"");

            GUIStyle labelStyle = new GUIStyle();

            labelStyle.imagePosition    = ImagePosition.ImageOnly;
            labelStyle.clipping         = TextClipping.Clip;
            labelStyle.padding          = new RectOffset(15, 0, 0, 0);
            labelStyle.stretchWidth     = true;
            labelStyle.stretchHeight    = true;
            labelStyle.hover.background = ControlIconHoverTex;

            bool shouldPing = EditorGUI.ToggleLeft(iconRect, labelContent, false, labelStyle);

            if (shouldPing)
            {
                EditorGUIUtility.PingObject((Object)pControl);
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void DrawLinkIcon(Object pSelf, ISettingsController pControl, Rect pPropertyRect)
        {
            bool isSelf = ((pControl as Object) == pSelf);

            Rect iconRect = pPropertyRect;
            iconRect.x -= 26;
            iconRect.y += 1;
            iconRect.width = 40;
            iconRect.height = 40;

            GUIContent labelContent = new GUIContent();
            labelContent.image = ControlIconTex;
            labelContent.tooltip = "Controlled by "+(isSelf ? "this component" :
                pControl.GetType().Name+" in \""+pControl.name+"\"");

            GUIStyle labelStyle = new GUIStyle();
            labelStyle.imagePosition = ImagePosition.ImageOnly;
            labelStyle.clipping = TextClipping.Clip;
            labelStyle.padding = new RectOffset(15, 0, 0, 0);
            labelStyle.stretchWidth = true;
            labelStyle.stretchHeight = true;

            bool shouldPing = EditorGUI.ToggleLeft(iconRect, labelContent, false, labelStyle);

            if ( shouldPing ) {
                EditorGUIUtility.PingObject((Object)pControl);
            }
        }