Exemplo n.º 1
0
    public void Touched()
    {
        if (GameManager.instance.timerAtBeginning != 1 || GameManager.instance.pause || !active)
        {
            return;
        }

        instruData = sound_manager.getData(indexForSoundManager);
        if (!instruData.on)
        {
            instruData.on           = true;
            instruData.currentState = 0;
            sound_manager.UnMute(indexForSoundManager);
            //Debug.Log("Unmute " + nameEventUnMute.Id);
        }
        else if (instruData.currentState == instruData.switches.Count || instruData.switches.Count == 0)
        {
            instruData.on           = false;
            instruData.currentState = 0;
            sound_manager.Mute(indexForSoundManager);
            //Debug.Log("Mute " + nameEventMute.Id);
        }

        if (instruData.switches.Count != 0)
        {
            sound_manager.Switch(indexForSoundManager);
            if (!instruData.on)
            {
                instruData.currentState = 0;
            }
        }
        else
        {
            Debug.Log("Error : did not have any state ", sound_manager.gameObject);
            instruData.currentState = instruData.on? 1:0;
        }

        ChangeOnClick();
    }
Exemplo n.º 2
0
 protected void ChangeOnUpdate()
 {
     instruData = sound_manager.getData(indexForSoundManager);
     onUpdatEvent.Invoke();
 }