using System; using UnityEngine; using UnityEngine.SceneManagement; using UnityStandardAssets.CrossPlatformInput;
[RequireComponent(typeof (UnityEngine.UI.Image))] publicclassForcedReset : MonoBehaviour { privatevoidUpdate() { // if we have forced a reset ... if (CrossPlatformInputManager.GetButtonDown("ResetObject")) { //... reload the scene SceneManager.LoadScene(SceneManager.GetSceneAt(0).name); } } }
namespaceUnityStandardAssets.Utility { publicclassSimpleActivatorMenu : MonoBehaviour { // An incredibly simple menu which, when given references // to gameobjects in the scene public UnityEngine.UI.Text camSwitchButton; public GameObject[] objects;
privateint m_CurrentActiveObject;
privatevoidOnEnable() { // active object starts from first in array m_CurrentActiveObject = 0; camSwitchButton.text = objects[m_CurrentActiveObject].name; }