private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(this); return; } _canvas = GetComponent <CanvasRenderer>(); }
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>(); } }