ForcedReset.cs 516 B

1234567891011121314151617181920
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using UnityEngine.SceneManagement;
  5. using UnityStandardAssets.CrossPlatformInput;
  6. #pragma warning disable 618
  7. [RequireComponent(typeof (Image))]
  8. public class ForcedReset : MonoBehaviour
  9. {
  10. private void Update()
  11. {
  12. // if we have forced a reset ...
  13. if (CrossPlatformInputManager.GetButtonDown("ResetObject"))
  14. {
  15. //... reload the scene
  16. SceneManager.LoadScene(SceneManager.GetSceneAt(0).name);
  17. }
  18. }
  19. }