UnityEngine.TextEditor.Copy C# (CSharp) Method

Copy() public method

public Copy ( ) : void
return void
        public void Copy()
        {
            if ((this.selectIndex != this.cursorIndex) && !this.isPasswordField)
            {
                string str;
                if (this.cursorIndex < this.selectIndex)
                {
                    str = this.text.Substring(this.cursorIndex, this.selectIndex - this.cursorIndex);
                }
                else
                {
                    str = this.text.Substring(this.selectIndex, this.cursorIndex - this.selectIndex);
                }
                GUIUtility.systemCopyBuffer = str;
            }
        }

Usage Example

コード例 #1
0
 internal static void CopyTextToClipboard(String CopyText)
 {
     TextEditor t = new TextEditor();
     t.content = new GUIContent(CopyText);
     t.SelectAll();
     t.Copy();
 }
All Usage Examples Of UnityEngine.TextEditor::Copy