Exemplo n.º 1
0
        private void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Destroy(this);
                return;
            }

            _canvas = GetComponent <CanvasRenderer>();
        }
Exemplo n.º 2
0
        private void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Destroy(this);
                return;
            }

            //finds necessary references
            _fadeToBlack         = FindObjectOfType <FadeToBlack>();
            _dialogueAudioSource = GetComponent <AudioSource>();
            if (_dialogueAudioSource == null)
            {
                _dialogueAudioSource = this.gameObject.AddComponent <AudioSource>();
            }
        }