c# 复制粘贴功能

2020-06-17  本文已影响0人  下雨天1993

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();

        }

    }

}

上一篇 下一篇

猜你喜欢

热点阅读