static int _g_get_audioMixer(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.Audio.AudioMixerSnapshot __cl_gen_to_be_invoked = (UnityEngine.Audio.AudioMixerSnapshot)translator.FastGetCSObj(L, 1);
                translator.Push(L, __cl_gen_to_be_invoked.audioMixer);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
Esempio n. 2
0
        protected override IEnumerator ExtractReferencesFromExternalSources()
        {
            yield return(base.ExtractReferencesFromExternalSources());

            string bossFSMName = "Control";

            objectToDestroyName = GetValueFromAction <string, FindGameObject>(gameObject, bossFSMName, "Blow", "objectName");

            yield return(GetGameObjectFromCreateObjectInFSM(gameObject, bossFSMName, "Blow", SetGameObject, false));                                                   //White Wave

            yield return(GetDataFromAction <SpawnRandomObjectsV2Data, SpawnRandomObjectsV2>(gameObject, bossFSMName, "Blow", SetSpawnRandomObjectsV2DataWithName));    //ControlBlowSpawnRandomObjectsV2

            yield return(GetDataFromAction <SpawnRandomObjectsV2Data, SpawnRandomObjectsV2>(gameObject, bossFSMName, "Blow", SetSpawnRandomObjectsV2DataWithName, 1)); //ControlBlowSpawnRandomObjectsV21

            yield return(GetAudioSourceFromAudioPlayerOneShotSingleInFSM(gameObject, bossFSMName, "Blow", SetActorAudioSource));

            yield return(GetAudioClipFromAudioPlayerOneShotSingleInFSM(gameObject, bossFSMName, "Blow", SetAudioClip));                            //Hornet_Fight_Death_01

            yield return(GetAudioClipFromAudioPlaySimpleInFSM(gameObject, bossFSMName, "Blow", SetAudioClip));                                     //boss_explode_clean

            yield return(GetAudioClipFromAudioPlayerOneShotSingleInFSM(gameObject, bossFSMName, "Jump", SetAudioClip));                            //Hornet_Fight_Stun_02

            yield return(GetAudioClipFromAudioPlayerOneShotSingleInFSM(gameObject, bossFSMName, "Throw", SetAudioClip));                           //hornet_needle_thow_spin

            yield return(GetValueFromAction <AudioClip, AudioPlayerOneShotSingle>(gameObject, bossFSMName, "Yank", "audioClip", SetAudioClip, 0)); //Hornet_Fight_Yell_03

            yield return(GetValueFromAction <AudioClip, AudioPlayerOneShotSingle>(gameObject, bossFSMName, "Yank", "audioClip", SetAudioClip, 1)); //hornet_dash

            audioSnapshot = GetSnapshotFromTransitionToAudioSnapshotInFSM(gameObject, bossFSMName, "Blow");                                        //Silent

            //load child references
            if (gameObject.FindGameObjectInChildren("Thread") != null)
            {
                thread = gameObject.FindGameObjectInChildren("Thread").GetComponent <tk2dSpriteAnimator>();
            }
            if (gameObject.FindGameObjectInChildren("Grass") != null)
            {
                grass = gameObject.FindGameObjectInChildren("Grass").GetComponent <ParticleSystem>();
            }
            if (gameObject.FindGameObjectInChildren("Start Pt") != null)
            {
                startPt = gameObject.FindGameObjectInChildren("Start Pt");
            }
            if (gameObject.FindGameObjectInChildren("Leave Anim") != null)
            {
                leaveAnim = gameObject.FindGameObjectInChildren("Leave Anim").GetComponent <tk2dSpriteAnimator>();
            }
            if (gameObject.FindGameObjectInChildren("Grass Escape") != null)
            {
                grassEscape = gameObject.FindGameObjectInChildren("Grass Escape").GetComponent <ParticleSystem>();
            }
        }
Esempio n. 3
0
        protected static void PlayBossMusic(UnityEngine.Audio.AudioMixerSnapshot mixerSnapshot, MusicCue musicCue)
        {
            //set the audio mixer snapshot
            if (mixerSnapshot != null)
            {
                mixerSnapshot.TransitionTo(1f);
            }

            // play the boss music music
            GameManager instance = GameManager.instance;

            instance.AudioManager.ApplyMusicCue(musicCue, 0f, 0f, false);
        }
Esempio n. 4
0
        /// <summary>
        /// Pull out any needed references from state machines or other game objects here
        ///
        /// Main helper functions to use:
        ///
        /// This function returns the value from the state machine, use for things that exist even when the object is inactive (like bools and stuff)
        /// public static T GetValueFromAction<T, U>(GameObject go, string fsmName, string stateName, string valueName, int? actionIndex = null)
        ///
        ///
        /// This function returns the value from the state machine using a callback and takes a few frames to make sure the unity game object is active and initialized before pulling the values out.
        /// This is required because some values, like audio clips, are null on prefabs that haven't been instantiated.
        /// public static IEnumerator GetValueFromAction<T, U>(GameObject go, string fsmName, string stateName, string valueName, Action<T> onValueLoaded, int? actionIndex = null)
        ///
        ///
        /// </summary>
        /// <returns></returns>
        protected override IEnumerator ExtractReferencesFromExternalSources()
        {
            yield return(base.ExtractReferencesFromExternalSources());

            //TODO: load any references that are needed

            //Example: Load an audio mixer snapshop
            audioSnapshot = GetValueFromAction <UnityEngine.Audio.AudioMixerSnapshot, TransitionToAudioSnapshot>(gameObject, "FSMName", "StateName", "variableName");

            //Example: Load an audio source
            yield return(GetValueFromAction <AudioSource, AudioPlayerOneShotSingle>(gameObject, "FSMName", "StateName", "variableName", SetAudioSource));

            //Example: Load an audio clip
            yield return(GetValueFromAction <AudioClip, AudioPlayerOneShotSingle>(gameObject, "FSMName", "StateName", "variableName", SetStateMachineValue, 0));
        }
        static int _m_TransitionTo(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.Audio.AudioMixerSnapshot __cl_gen_to_be_invoked = (UnityEngine.Audio.AudioMixerSnapshot)translator.FastGetCSObj(L, 1);


            try {
                {
                    float timeToReach = (float)LuaAPI.lua_tonumber(L, 2);

                    __cl_gen_to_be_invoked.TransitionTo(timeToReach);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Esempio n. 6
0
        static int _m_FindSnapshot(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.Audio.AudioMixer __cl_gen_to_be_invoked = (UnityEngine.Audio.AudioMixer)translator.FastGetCSObj(L, 1);


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

                    UnityEngine.Audio.AudioMixerSnapshot __cl_gen_ret = __cl_gen_to_be_invoked.FindSnapshot(name);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Esempio n. 7
0
 static void AudioManager_ApplyMusicSnapshot(On.AudioManager.orig_ApplyMusicSnapshot orig, AudioManager self, UnityEngine.Audio.AudioMixerSnapshot snapshot, float delayTime, float transitionTime)
 {
     orig(self, snapshot, delayTime, transitionTime);
 }
Esempio n. 8
0
 public AudioMixerSnapshotData(UnityEngine.Audio.AudioMixerSnapshot v)
 {
     audioMixerSnapshotVal = v;
     audioMixerSnapshotRef = null;
 }