void awake() { if (uiManager == null) { uiManager = this; } else if (uiManager != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); HideQuestPanel(); }
void Awake() { // check if UI exists if (uiManager == null) { //if not set it to this uiManager = this; } //if UI already exists and is not this else if (uiManager != this) { //destroy it Destroy(gameObject); } //set this to not getting destroyed when loading another scene DontDestroyOnLoad(gameObject); //FIND PANEL QuestPanel = GameObject.FindGameObjectWithTag("QuestPanel"); QuestLogPanel = GameObject.FindGameObjectWithTag("QuestLogPanel"); //HIDE PANEL HideQuestPanel(); HideQuestLogPanel(); }