我需要在下面的代码中创建允许克隆按钮的新按钮,请分享一些想法、代码、链接、脚本。我会很高兴得到任何帮助。先感谢您!
using UnityEngine;
using System.Collections;
public class hibye: MonoBehaviour
{
public string slectedItem = "fd";
private bool editing = false;
private void OnGUI()
{
if ( GUILayout.Button(slectedItem))
{
editing = true;
}
if (editing)
{
string[] sig = {"Banana","Apple","Orange"};
for (int x = 0; x < sig.Length ; x++)
{
if (GUILayout.Button(sig[x]))
{
slectedItem = sig[x];
editing = false;
}
}
}
}
}