Exemplo n.º 1
0
        private AudioSource CreateAudioSource(AudioClip clip, GameObject parent)
        {
            var source = parent.AddComponent <AudioSource>();

            source.clip        = clip;
            source.spatialize  = false;
            source.volume      = JoinNotifierSettings.GetSoundVolume();
            source.loop        = false;
            source.playOnAwake = false;
            if (JoinNotifierSettings.GetUseUiMixer())
            {
                source.outputAudioMixerGroup = VRCAudioManager.field_Private_Static_VRCAudioManager_0.uiGroup;
            }
            return(source);
        }
Exemplo n.º 2
0
        public override void OnModSettingsApplied()
        {
            MelonLogger.Log("Settings apply start");
            if (myJoinSource != null)
            {
                myJoinSource.volume = JoinNotifierSettings.GetSoundVolume();
                myJoinSource.outputAudioMixerGroup = JoinNotifierSettings.GetUseUiMixer() ? VRCAudioManager.field_Private_Static_VRCAudioManager_0.uiGroup : null;
            }

            if (myLeaveSource != null)
            {
                myLeaveSource.volume = JoinNotifierSettings.GetSoundVolume();
                myLeaveSource.outputAudioMixerGroup = JoinNotifierSettings.GetUseUiMixer() ? VRCAudioManager.field_Private_Static_VRCAudioManager_0.uiGroup : null;
            }

            if (myJoinImage != null)
            {
                myJoinImage.color = JoinNotifierSettings.GetJoinIconColor();
            }

            if (myLeaveImage != null)
            {
                myLeaveImage.color = JoinNotifierSettings.GetLeaveIconColor();
            }

            if (myJoinText != null)
            {
                myJoinText.fontSize = JoinNotifierSettings.GetTextSize();
                myJoinText.color    = JoinNotifierSettings.GetJoinIconColor();
            }

            if (myLeaveText != null)
            {
                myLeaveText.fontSize = JoinNotifierSettings.GetTextSize();
                myLeaveText.color    = JoinNotifierSettings.GetLeaveIconColor();
            }
            MelonLogger.Log("Settings apply done");
        }