A singleton game object which displays a simple UI for the save system.
Inheritance: UnityEngine.MonoBehaviour
Exemple #1
0
        protected virtual void Awake()
        {
            // Only one instance of SaveMenu may exist
            if (instance != null)
            {
                Destroy(gameObject);
                return;
            }

            instance = this;

            GameObject.DontDestroyOnLoad(this);

            clickAudioSource = GetComponent <AudioSource>();
        }
Exemple #2
0
        protected virtual void Awake()
        {
            // Only one instance of SaveMenu may exist
            if (instance != null)
            {
                Destroy(gameObject);
                return;
            }

            instance = this;

            GameObject.DontDestroyOnLoad(this);

            clickAudioSource = GetComponent<AudioSource>();
        }
        protected virtual void Awake()
        {
            // Only one instance of SaveMenu may exist
            if (instance != null)
            {
                Destroy(gameObject);
                return;
            }

            instance = this;

            if (transform.parent == null)
            {
                GameObject.DontDestroyOnLoad(this);
            }
            else
            {
                Debug.LogError("Save Menu cannot be preserved across scene loads if it is a child of another GameObject.");
            }

            clickAudioSource = GetComponent <AudioSource>();
        }
Exemple #4
0
    //public string key;

    // Use this for initialization
    void Start()
    {
        //save = GameObject.Find("/DontDestroyOnLoad/SaveMenu");
        saveMenu = gameObject.GetComponent <SaveMenu>();
    }