private void Awake() { messagesBroker = FindObjectOfType <MessagesBroker>(); if (messagesBroker == null) { throw new System.Exception(string.Format("Missing Messages broker, Talker {0} requires a message broker to talk.", name)); } }
private void Awake() { messagesQueue = new MessagesQueue(); if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); }