// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); if (playMusic != null) { audioSource.clip = playMusic; audioSource.Play(); } GameMessageBus.AddMessageListener(MessageType.Lost, this); GameMessageBus.AddMessageListener(MessageType.Muted, this); }
private void Listen() { IMessageHandler thisHandler = (IMessageHandler)this; foreach (MessageType mesageType in SupportedMessageMap.Keys) { GameMessageBus.AddMessageListener(mesageType, thisHandler); } }