c# 复制粘贴功能

1、

 using UnityEngine.UI;

public class copy : MonoBehaviour

{

    TextEditor te = new TextEditor();

    public Text oldtext;

    public Text newtext;

    void Update()

    {

        if (Input.GetMouseButtonDown(0))

        {

            te.text = oldtext.text;

            te.SelectAll();

            te.Copy();

        }

        if (Input.GetMouseButtonDown(1))

        {

            newtext.text = te.text;

            te.Paste();

        }

    }

}

你可能感兴趣的:(c# 复制粘贴功能)