コード例 #1
0
    // 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);
    }
コード例 #2
0
    private void Listen()
    {
        IMessageHandler thisHandler = (IMessageHandler)this;

        foreach (MessageType mesageType in SupportedMessageMap.Keys)
        {
            GameMessageBus.AddMessageListener(mesageType, thisHandler);
        }
    }