Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static PersistentManagerScript Instance { get; private set; }
- public string Value;
- private void Awake()
- {
- if (Instance == null) {
- Instance = this;
- DontDestroyOnLoad (gameObject);
- }
- else
- {
- Destroy (gameObject);
- }
- }
- // Use this for initialization
- void Start () {
- Value = "camilo";
- }
- // Update is called once per frame
- void Update () {
- }
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityEngine.SceneManagement;
- public class SceneManagerScript : MonoBehaviour {
- public Text ValueTxt;
- private void Start()
- {
- ValueTxt.text = PersistentManagerScript.Instance.Value.ToString ();
- }
- public void GoToCategories()
- {
- SceneManager.LoadScene ("Categories");
- PersistentManagerScript.Instance.Value;
- }
- public void GoToSubCategories()
- {
- SceneManager.LoadScene("subcategories");
- PersistentManagerScript.Instance.Value;
- }
Add Comment
Please, Sign In to add comment