Пример #1
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Audio.AudioMixerGroup audioMixerGroup = (UnityEngine.Audio.AudioMixerGroup)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "name":
                    audioMixerGroup.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    audioMixerGroup.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Пример #2
0
        static StackObject *set_outputAudioMixerGroup_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Audio.AudioMixerGroup value = (UnityEngine.Audio.AudioMixerGroup) typeof(UnityEngine.Audio.AudioMixerGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Audio.AudioMixer instance_of_this_method;
            instance_of_this_method = (UnityEngine.Audio.AudioMixer) typeof(UnityEngine.Audio.AudioMixer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.outputAudioMixerGroup = value;

            return(__ret);
        }
Пример #3
0
        public void PlayRequest(MusicRequest req, object entry, float time, UnityEngine.Audio.AudioMixerGroup group)
        {
            m_Stop  = false;
            Entry   = entry;
            Request = req;
            Music   = req.Music;
            Music.AddRef();

            m_Object.SetActive(true);

            m_Source.clip = Music.Clip;
            m_Source.outputAudioMixerGroup = group;
            m_Source.pitch       = Music.Pitch;
            m_Source.volume      = 0;
            m_Source.timeSamples = Request.Position;
            m_Source.Play();
            m_FadeVolume.Start(0, 1f, time);
        }
Пример #4
0
        static int _m_GetAudioMixerGroup(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            xc.AudioManager __cl_gen_to_be_invoked = (xc.AudioManager)translator.FastGetCSObj(L, 1);


            try {
                {
                    string name = LuaAPI.lua_tostring(L, 2);

                    UnityEngine.Audio.AudioMixerGroup __cl_gen_ret = __cl_gen_to_be_invoked.GetAudioMixerGroup(name);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Пример #5
0
 public AudioMixerGroupData(UnityEngine.Audio.AudioMixerGroup v)
 {
     audioMixerGroupVal = v;
     audioMixerGroupRef = null;
 }
Пример #6
0
        void OnGUI()
        {
            maxSize = new Vector2(390f, 315f);
            minSize = maxSize;

            GUILayout.Space(10f);

            var centeredStyle = new GUIStyle(GUI.skin.GetStyle("Label"));

            centeredStyle.alignment = TextAnchor.UpperCenter;

            GUILayout.Label(logoTex, centeredStyle);

            GUIStyle contentStyle = new GUIStyle(EditorStyles.label);

            contentStyle.alignment = TextAnchor.MiddleCenter;

            UnityEngine.Audio.AudioMixerGroup prevSfxMixerGroup = config.sfxAudioMixerGroup;
            UnityEngine.Audio.AudioMixerGroup prevBgmMixerGroup = config.bgmAudioMixerGroup;
            LayerMask prevOccludeCheck            = config.occludeCheck;
            float     prevOccludeMultiplier       = config.occludeMultiplier;
            uint      prevMaxAudioSources         = config.maxAudioSources;
            string    prevRuntimeIdentifierPrefix = config.runtimeIdentifierPrefix;
            float     prevDopplerFactor           = config.dopplerFactor;

            GUIStyle versionStyle = new GUIStyle(EditorStyles.miniLabel);

            versionStyle.alignment = TextAnchor.MiddleCenter;

            EditorGUILayout.LabelField("Global Config", versionStyle);

            GUILayout.Space(5f);

            EditorGUI.BeginChangeCheck();
            UnityEngine.Audio.AudioMixerGroup sfxMixerGroup = EditorGUILayout.ObjectField(new GUIContent("SFX Mixer Group", "Default SFX Mixer Group Output"), config.sfxAudioMixerGroup, typeof(UnityEngine.Audio.AudioMixerGroup), false) as UnityEngine.Audio.AudioMixerGroup;
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed SFX Mixer Group");
                config.sfxAudioMixerGroup = sfxMixerGroup;
            }

            EditorGUI.BeginChangeCheck();
            UnityEngine.Audio.AudioMixerGroup bgmMixerGroup = EditorGUILayout.ObjectField(new GUIContent("BGM Mixer Group", "Default BGM Mixer Group Output"), config.bgmAudioMixerGroup, typeof(UnityEngine.Audio.AudioMixerGroup), false) as UnityEngine.Audio.AudioMixerGroup;
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed BGM Mixer Group");
                config.bgmAudioMixerGroup = bgmMixerGroup;
            }

            EditorGUI.BeginChangeCheck();
            LayerMask occludeCheck = LayerMaskField(new GUIContent("Occlude Check Layer", "Layer Mask used for check whether or not a collider occludes the sound. Tip: Use a unique layer for the occludable colliders, then you can have more control putting invisible triggers on the objects that you want to occludes sound"), config.occludeCheck);

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed Occlude Check Layer");
                config.occludeCheck = occludeCheck;
            }

            EditorGUI.BeginChangeCheck();
            float occludeMultiplier = Mathf.Clamp01(EditorGUILayout.Slider(new GUIContent("Occlude Multiplier", "The higher the value, the less the audio is heard when occluded"), Mathf.Clamp01(config.occludeMultiplier), 0f, 1f));

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed Occlude Multiplier");
                config.occludeMultiplier = occludeMultiplier;
            }

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            string prefix = EditorGUILayout.TextField(new GUIContent("Runtime Identifier Prefix", "The prefix used to define Runtime Identifiers"), config.runtimeIdentifierPrefix);

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed Runtime Identifier Prefix");
                config.runtimeIdentifierPrefix = prefix;
            }

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            uint maxAudioSources = (uint)Mathf.Clamp(EditorGUILayout.IntField(new GUIContent("Max Audio Sources", "Max pooled Multi Audio Sources"), (int)Mathf.Clamp(config.maxAudioSources, 1, 2048)), 1, 2048);

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed Max Audio Sources");
                config.maxAudioSources = maxAudioSources;
            }

            EditorGUILayout.HelpBox("To get the best performance only increase this value if you are having problems when playing pooled audios, otherwise keep this value as low as possible.", MessageType.Info);

            EditorGUILayout.Space();

            EditorGUI.BeginChangeCheck();
            float dopplerFactor = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Doppler Factor", "Set how audible the Doppler effect is. Use 0 to disable it. Use 1 make it audible for fast moving objects."), Mathf.Clamp(config.dopplerFactor, 0, 10)), 0, 10);

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(config, "Changed Doppler Factor");
                config.dopplerFactor = dopplerFactor;
            }

            if (prevRuntimeIdentifierPrefix != config.runtimeIdentifierPrefix || prevSfxMixerGroup != config.sfxAudioMixerGroup || prevBgmMixerGroup != config.bgmAudioMixerGroup || config.occludeCheck != prevOccludeCheck || prevOccludeMultiplier != config.occludeMultiplier || prevMaxAudioSources != config.maxAudioSources || prevDopplerFactor != config.dopplerFactor)
            {
                EditorUtility.SetDirty(config);
            }
        }
Пример #7
0
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.Audio.AudioMixerGroup audioMixerGroup = (UnityEngine.Audio.AudioMixerGroup)value;
     writer.WriteProperty("name", audioMixerGroup.name);
     writer.WriteProperty("hideFlags", audioMixerGroup.hideFlags);
 }