Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- using UnityEngine.UI;
- public class LevelSelectDude : MonoBehaviour {
- private string targetBuildPath;
- private Text buttonText;
- public void SetBuildTarget(string target)
- {
- targetBuildPath = target;
- buttonText = GetComponentInChildren<Text>();
- buttonText.text = System.IO.Path.GetFileNameWithoutExtension(target);
- }
- public void GoToLevel()
- {
- SceneManager.LoadScene(targetBuildPath);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement