FairyGUI.CopyPastePatch.OnCopy C# (CSharp) Method

OnCopy() public static method

public static OnCopy ( InputTextField textField, string value ) : void
textField InputTextField
value string
return void
        public static void OnCopy(InputTextField textField, string value)
        {
            TextEditor te = new TextEditor();
            #if UNITY_5_3_OR_NEWER
            te.text = value;
            #else
            te.content = new GUIContent(value);
            #endif
            te.OnFocus();
            te.Copy();
        }

Usage Example

Example #1
0
        void DoCopy(string value)
        {
#if UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
            CopyPastePatch.OnCopy(this, value);
#else
            if (onCopy != null)
            {
                onCopy(this, value);
            }
#endif
        }