Advertisement
eastbayeff

Untitled

Jun 3rd, 2022
1,033
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. using UnityEngine.UI;
  6.  
  7. public class LevelSelectDude : MonoBehaviour {
  8.     private string targetBuildPath;
  9.     private Text buttonText;
  10.     public void SetBuildTarget(string target)
  11.     {
  12.         targetBuildPath = target;
  13.         buttonText = GetComponentInChildren<Text>();
  14.         buttonText.text = System.IO.Path.GetFileNameWithoutExtension(target);
  15.  
  16.     }
  17.     public void GoToLevel()
  18.     {
  19.         SceneManager.LoadScene(targetBuildPath);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement