LoadLevelOnClick.cs 295 B

12345678910111213141516
  1. using System;
  2. using UnityEngine;
  3. [AddComponentMenu("NGUI/Examples/Load Level On Click")]
  4. public class LoadLevelOnClick : MonoBehaviour
  5. {
  6. private void OnClick()
  7. {
  8. if (!string.IsNullOrEmpty(this.levelName))
  9. {
  10. Application.LoadLevel(this.levelName);
  11. }
  12. }
  13. public string levelName;
  14. }