unity spawn object code example
Example 1: python spawn shell
python -c 'import pty;pty.spawn("/bin/bash")'
Example 2: python clone object
import copy
new_ob = copy.deepcopy(old_ob)
Example 3: unity spawn button
GameObject buttonPrefab;
void MyAwesomeCreator()
{
GameObject go = Instantiate(buttonPrefab);
var button = GetComponent<UnityEngine.UI.Button>();
button.onClick.AddListener(() => FooOnClick());
}
void FooOnClick()
{
Debug.Log("Ta-Da!");
}