美文网首页
c# 复制粘贴功能

c# 复制粘贴功能

作者: 下雨天1993 | 来源:发表于2020-06-17 21:31 被阅读0次

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# 复制粘贴功能

      本文链接:https://www.haomeiwen.com/subject/osdexktx.html