A singleton game object which displays a simple UI for the save system.
Inheritance: UnityEngine.MonoBehaviour
示例#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>();
        }
示例#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>();
        }
示例#3
0
        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>();
        }
示例#4
0
    //public string key;

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