How to make a clones for the buttons? [closed]
- by user1764781
I need to create the new button that allows to make the clone of buttons in the code below.
Please share some ideas, codes, links, scripts.
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;
}
}
}
}
}