15 lines
274 B
C#
15 lines
274 B
C#
using UnityEngine;
|
|
|
|
[AddComponentMenu("NGUI/Examples/Load Level On Click")]
|
|
public class LoadLevelOnClick : MonoBehaviour
|
|
{
|
|
public string levelName;
|
|
|
|
void OnClick ()
|
|
{
|
|
if (!string.IsNullOrEmpty(levelName))
|
|
{
|
|
Application.LoadLevel(levelName);
|
|
}
|
|
}
|
|
} |