Ejemplo n.º 1
0
        internal override void Update()
        {
            switch (Style)
            {
            case 0:
                InputCaret.Hide();
                break;

            case 2:
                if (ShowChanged)
                {
                    InputCaret.Active();
                    ShowChanged = false;
                    List <HVertex> hs   = new List <HVertex>();
                    List <int>     tris = new List <int>();
                    GetSelectArea(SelectionColor, tris, hs);
                    InputCaret.ChangeCaret(hs.ToArray(), tris.ToArray());
                }
                break;
            }
            if (Focus)
            {
                if (Keyboard.GetKeyDown(KeyCode.C) & Keyboard.GetKey(KeyCode.LeftControl))
                {
                    GUIUtility.systemCopyBuffer = GetSelectString();
                }
                if (Keyboard.GetKeyDown(KeyCode.A) & Keyboard.GetKey(KeyCode.LeftControl))
                {
                    SelectAll();
                    ShowChanged = true;
                }
            }
        }
Ejemplo n.º 2
0
 public override void OnMouseDown(UserAction action)
 {
     Focus = true;
     if (TextCom != null)
     {
         EndPress = StartPress = GetPressIndex(action, Vector2.zero);
         InputCaret.SetParent(TextCom.transform);
         InputCaret.Active();
         ShowChanged = true;
     }
     base.OnMouseDown(action);
 }
Ejemplo n.º 3
0
        void Refresh()
        {
            InputCaret.CaretStyle = Style;
            var te = TextCom;

            if (te != null)
            {
                if (textChanged)
                {
                    textChanged = false;
                    GetPreferredHeight();
                }
                if (lineChanged)
                {
                    lineChanged = false;
                    SetShowText();
                    TextCom.Populate();
                    ShowChanged = true;
                }
                if (Style == 2)
                {
                    if (ShowChanged)
                    {
                        ShowChanged = false;
                        InputCaret.Active();
                        List <HVertex> hs   = new List <HVertex>();
                        List <int>     tris = new List <int>();
                        GetSelectArea(SelectionColor, tris, hs);
                        InputCaret.ChangeCaret(hs.ToArray(), tris.ToArray());
                    }
                }
                else if (ShowChanged)
                {
                    ShowChanged = false;
                    SetShowText();
                }
            }
        }