コード例 #1
0
ファイル: GUIStyle.cs プロジェクト: sgf/Unity5.3Decompiled
 internal void DrawWithTextSelection(Rect position, GUIContent content, int controlID, int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
 {
     if (Event.current.type != EventType.Repaint)
     {
         Debug.LogError("Style.Draw may not be called if it is not a repaint event");
     }
     else
     {
         Event current          = Event.current;
         Color cursorColor      = new Color(0f, 0f, 0f, 0f);
         float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
         float num2             = ((Time.realtimeSinceStartup - Internal_GetCursorFlashOffset()) % cursorFlashSpeed) / cursorFlashSpeed;
         if ((cursorFlashSpeed == 0f) || (num2 < 0.5f))
         {
             cursorColor = GUI.skin.settings.cursorColor;
         }
         Internal_DrawWithTextSelectionArguments arguments = new Internal_DrawWithTextSelectionArguments {
             target                     = this.m_Ptr,
             position                   = position,
             firstPos                   = firstSelectedCharacter,
             lastPos                    = lastSelectedCharacter,
             cursorColor                = cursorColor,
             selectionColor             = GUI.skin.settings.selectionColor,
             isHover                    = !position.Contains(current.mousePosition) ? 0 : 1,
             isActive                   = (controlID != GUIUtility.hotControl) ? 0 : 1,
             on                         = 0,
             hasKeyboardFocus           = ((controlID != GUIUtility.keyboardControl) || !showKeyboardFocus) ? 0 : 1,
             drawSelectionAsComposition = !drawSelectionAsComposition ? 0 : 1
         };
         Internal_DrawWithTextSelection(content, ref arguments);
     }
 }
コード例 #2
0
        internal void DrawWithTextSelection(Rect position, GUIContent content, bool isActive, bool hasKeyboardFocus, int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
        {
            Event current          = Event.current;
            Color cursorColor      = new Color(0f, 0f, 0f, 0f);
            float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
            float num = (Time.realtimeSinceStartup - GUIStyle.Internal_GetCursorFlashOffset()) % cursorFlashSpeed / cursorFlashSpeed;

            if (cursorFlashSpeed == 0f || num < 0.5f)
            {
                cursorColor = GUI.skin.settings.cursorColor;
            }
            Internal_DrawWithTextSelectionArguments internal_DrawWithTextSelectionArguments = default(Internal_DrawWithTextSelectionArguments);

            internal_DrawWithTextSelectionArguments.target                     = this.m_Ptr;
            internal_DrawWithTextSelectionArguments.position                   = position;
            internal_DrawWithTextSelectionArguments.firstPos                   = firstSelectedCharacter;
            internal_DrawWithTextSelectionArguments.lastPos                    = lastSelectedCharacter;
            internal_DrawWithTextSelectionArguments.cursorColor                = cursorColor;
            internal_DrawWithTextSelectionArguments.selectionColor             = GUI.skin.settings.selectionColor;
            internal_DrawWithTextSelectionArguments.isHover                    = ((!position.Contains(current.mousePosition)) ? 0 : 1);
            internal_DrawWithTextSelectionArguments.isActive                   = ((!isActive) ? 0 : 1);
            internal_DrawWithTextSelectionArguments.on                         = 0;
            internal_DrawWithTextSelectionArguments.hasKeyboardFocus           = ((!hasKeyboardFocus) ? 0 : 1);
            internal_DrawWithTextSelectionArguments.drawSelectionAsComposition = ((!drawSelectionAsComposition) ? 0 : 1);
            GUIStyle.Internal_DrawWithTextSelection(content, ref internal_DrawWithTextSelectionArguments);
        }
コード例 #3
0
ファイル: GUIStyle.cs プロジェクト: zuohu/UnityDecompiled
 internal void DrawWithTextSelection(Rect position, GUIContent content, int controlID, int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
 {
     if (Event.current.type != EventType.Repaint)
     {
         Debug.LogError("Style.Draw may not be called if it is not a repaint event");
     }
     else
     {
         Event current          = Event.current;
         Color cursorColor      = new Color(0f, 0f, 0f, 0f);
         float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
         float num = (Time.realtimeSinceStartup - GUIStyle.Internal_GetCursorFlashOffset()) % cursorFlashSpeed / cursorFlashSpeed;
         if (cursorFlashSpeed == 0f || num < 0.5f)
         {
             cursorColor = GUI.skin.settings.cursorColor;
         }
         Internal_DrawWithTextSelectionArguments internal_DrawWithTextSelectionArguments = default(Internal_DrawWithTextSelectionArguments);
         internal_DrawWithTextSelectionArguments.target                     = this.m_Ptr;
         internal_DrawWithTextSelectionArguments.position                   = position;
         internal_DrawWithTextSelectionArguments.firstPos                   = firstSelectedCharacter;
         internal_DrawWithTextSelectionArguments.lastPos                    = lastSelectedCharacter;
         internal_DrawWithTextSelectionArguments.cursorColor                = cursorColor;
         internal_DrawWithTextSelectionArguments.selectionColor             = GUI.skin.settings.selectionColor;
         internal_DrawWithTextSelectionArguments.isHover                    = ((!position.Contains(current.mousePosition)) ? 0 : 1);
         internal_DrawWithTextSelectionArguments.isActive                   = ((controlID != GUIUtility.hotControl) ? 0 : 1);
         internal_DrawWithTextSelectionArguments.on                         = 0;
         internal_DrawWithTextSelectionArguments.hasKeyboardFocus           = ((controlID != GUIUtility.keyboardControl || !GUIStyle.showKeyboardFocus) ? 0 : 1);
         internal_DrawWithTextSelectionArguments.drawSelectionAsComposition = ((!drawSelectionAsComposition) ? 0 : 1);
         GUIStyle.Internal_DrawWithTextSelection(content, ref internal_DrawWithTextSelectionArguments);
     }
 }
コード例 #4
0
ファイル: GUIStyle.cs プロジェクト: Hengle/JellyTerain
        internal void DrawWithTextSelection(Rect position, GUIContent content, int controlID, int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
        {
            Event current          = Event.current;
            Color cursorColor      = new Color(0f, 0f, 0f, 0f);
            float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
            float num = (Time.realtimeSinceStartup - Internal_GetCursorFlashOffset()) % cursorFlashSpeed / cursorFlashSpeed;

            if (cursorFlashSpeed == 0f || num < 0.5f)
            {
                cursorColor = GUI.skin.settings.cursorColor;
            }
            Internal_DrawWithTextSelectionArguments arguments = default(Internal_DrawWithTextSelectionArguments);

            arguments.target                     = m_Ptr;
            arguments.position                   = position;
            arguments.firstPos                   = firstSelectedCharacter;
            arguments.lastPos                    = lastSelectedCharacter;
            arguments.cursorColor                = cursorColor;
            arguments.selectionColor             = GUI.skin.settings.selectionColor;
            arguments.isHover                    = (position.Contains(current.mousePosition) ? 1 : 0);
            arguments.isActive                   = ((controlID == GUIUtility.hotControl) ? 1 : 0);
            arguments.on                         = 0;
            arguments.hasKeyboardFocus           = ((controlID == GUIUtility.keyboardControl && showKeyboardFocus) ? 1 : 0);
            arguments.drawSelectionAsComposition = (drawSelectionAsComposition ? 1 : 0);
            Internal_DrawWithTextSelection(content, ref arguments);
        }
コード例 #5
0
        internal void DrawWithTextSelection(Rect position, GUIContent content, bool isActive, bool hasKeyboardFocus,
                                            int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
        {
            if (Event.current.type != EventType.Repaint)
            {
                Debug.LogError("Style.Draw may not be called if it is not a repaint event");
                return;
            }

            Event e = Event.current;

            // Figure out the cursor color...
            Color cursorColor      = new Color(0, 0, 0, 0);
            float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
            float cursorFlashRel   = ((Time.realtimeSinceStartup - Internal_GetCursorFlashOffset()) % cursorFlashSpeed) / cursorFlashSpeed;

            if (cursorFlashSpeed == 0 || cursorFlashRel < .5f)
            {
                cursorColor = GUI.skin.settings.cursorColor;
            }

            Internal_DrawWithTextSelectionArguments arguments = new Internal_DrawWithTextSelectionArguments();

            arguments.target                     = m_Ptr;
            arguments.position                   = position;
            arguments.firstPos                   = firstSelectedCharacter;
            arguments.lastPos                    = lastSelectedCharacter;
            arguments.cursorColor                = cursorColor;
            arguments.selectionColor             = GUI.skin.settings.selectionColor;
            arguments.isHover                    = position.Contains(e.mousePosition) ? 1 : 0;
            arguments.isActive                   = isActive ? 1 : 0;
            arguments.on                         = 0;
            arguments.hasKeyboardFocus           = hasKeyboardFocus ? 1 : 0;
            arguments.drawSelectionAsComposition = drawSelectionAsComposition ? 1 : 0;

            Internal_DrawWithTextSelection(content, ref arguments);
        }
コード例 #6
0
ファイル: GUIStyle.cs プロジェクト: sgf/Unity5.3Decompiled
 private static extern void Internal_DrawWithTextSelection(GUIContent content, ref Internal_DrawWithTextSelectionArguments arguments);
コード例 #7
0
 private static extern void Internal_DrawWithTextSelection(GUIContent content, ref Internal_DrawWithTextSelectionArguments arguments);
コード例 #8
0
ファイル: GUIStyle.cs プロジェクト: CarlosHBC/UnityDecompiled
 internal void DrawWithTextSelection(Rect position, GUIContent content, int controlID, int firstSelectedCharacter, int lastSelectedCharacter, bool drawSelectionAsComposition)
 {
     if (Event.current.type != EventType.Repaint)
     {
         Debug.LogError("Style.Draw may not be called if it is not a repaint event");
     }
     else
     {
         Event current = Event.current;
         Color cursorColor = new Color(0f, 0f, 0f, 0f);
         float cursorFlashSpeed = GUI.skin.settings.cursorFlashSpeed;
         float num2 = ((Time.realtimeSinceStartup - Internal_GetCursorFlashOffset()) % cursorFlashSpeed) / cursorFlashSpeed;
         if ((cursorFlashSpeed == 0f) || (num2 < 0.5f))
         {
             cursorColor = GUI.skin.settings.cursorColor;
         }
         Internal_DrawWithTextSelectionArguments arguments = new Internal_DrawWithTextSelectionArguments {
             target = this.m_Ptr,
             position = position,
             firstPos = firstSelectedCharacter,
             lastPos = lastSelectedCharacter,
             cursorColor = cursorColor,
             selectionColor = GUI.skin.settings.selectionColor,
             isHover = !position.Contains(current.mousePosition) ? 0 : 1,
             isActive = (controlID != GUIUtility.hotControl) ? 0 : 1,
             on = 0,
             hasKeyboardFocus = ((controlID != GUIUtility.keyboardControl) || !showKeyboardFocus) ? 0 : 1,
             drawSelectionAsComposition = !drawSelectionAsComposition ? 0 : 1
         };
         Internal_DrawWithTextSelection(content, ref arguments);
     }
 }
コード例 #9
0
 private static void Internal_DrawWithTextSelection(GUIContent content, ref Internal_DrawWithTextSelectionArguments arguments)
 {
     throw new NotImplementedException("なにこれ");
 }