} //end of Start() void OnActivate(bool isTrue) { if (isTrue && state == State.On) { hSoundManagerCS.toggleMusicEnabled(true); } else if (isTrue && state == State.Off) { hSoundManagerCS.toggleMusicEnabled(false); } }
/* * FUNCTION: Handle the clicks on Information menu. * CALLED BY: listenerClicks() */ private void handlerSettingsMenu(Transform buttonTransform) { if (tSettingsButtons[0] == buttonTransform) //home button { CloseMenu((int)MenuIDs.SettingsMenu); ShowMenu((int)MenuIDs.MainMenu); } else if (tSettingsButtons[1] == buttonTransform) //swipe controls { if (mrSwipeControls.enabled == false) { mrSwipeControls.enabled = true; mrGyroControls.enabled = false; hControllerScriptCS.toggleSwipeControls(true); } } else if (tSettingsButtons[2] == buttonTransform) //gyro controls { if (mrGyroControls.enabled == false) { mrGyroControls.enabled = true; mrSwipeControls.enabled = false; hControllerScriptCS.toggleSwipeControls(false); } } else if (tSettingsButtons[3] == buttonTransform) //music ON radio button { if (mrMusicON.enabled == false) { mrMusicON.enabled = true; mrMusicOFF.enabled = false; hSoundManagerScriptCS.toggleMusicEnabled(true); } } else if (tSettingsButtons[4] == buttonTransform) //music OFF radio button { if (mrMusicON.enabled == true) { mrMusicON.enabled = false; mrMusicOFF.enabled = true; hSoundManagerScriptCS.toggleMusicEnabled(false); } } else if (tSettingsButtons[5] == buttonTransform) //music ON radio button { if (mrSoundON.enabled == false) { mrSoundON.enabled = true; mrSoundOFF.enabled = false; hSoundManagerScriptCS.toggleSoundEnabled(true); } } else if (tSettingsButtons[6] == buttonTransform) //music ON radio button { if (mrSoundON.enabled == true) { mrSoundON.enabled = false; mrSoundOFF.enabled = true; hSoundManagerScriptCS.toggleSoundEnabled(false); } } }