Quantcast
Viewing all articles
Browse latest Browse all 92

Need hep changing this script to a onclick script.... please help

here is the script public static class LevelManager { private static string lastLevel; public static void setLastLevel(string level) { lastLevel = level; } public static string getLastLevel() { return lastLevel; } public static void changeToPreviousLvl() { Application.LoadLevel(lastLevel); } } i want it to load the previous scene on click... kinda like this code that loads a set scene on click. using UnityEngine; using System.Collections; public class LoadOnClick : MonoBehaviour { public GameObject loadingImage; public void LoadScene(int level) { loadingImage.SetActive(true); Application.LoadLevel(level); } }

Viewing all articles
Browse latest Browse all 92

Trending Articles