public static bool FindTalkManager(out TalkManager talkManagerOut) { talkManagerOut = GameObject.FindObjectOfType <TalkManager>(); if (talkManagerOut == null) { DaggerfallUnity.LogMessage("Could not locate TalkManager GameObject instance in scene!", true); return(false); } return(true); }
private void SetupSingleton() { if (instance == null) { instance = this; } else if (instance != this) { if (Application.isPlaying) { DaggerfallUnity.LogMessage("Multiple TalkManager instances detected in scene!", true); Destroy(gameObject); } } }