private void OnGUI() { if (GUI.Button(new Rect(5f, Screen.height - 25, 80f, 20f), "Reset")) { currentSelection.Destroy(); Object.Destroy(preview.gameObject); SpawnCube(); } }
/** * \brief This is the usual Unity OnGUI method. We only use it to show a 'Reset' button. */ void OnGUI() { // To reset, nuke the pb_Object and build a new one. if (GUI.Button(new Rect(5, Screen.height - 25, 80, 20), "Reset")) { currentSelection.Destroy(); Destroy(preview.gameObject); SpawnCube(); } }