예제 #1
0
        public void SetSoundsList(eAudioM_FootSoundType aType, List <AudioClip> aSoundsList)
        {
            switch (aType)
            {
            case eAudioM_FootSoundType.Walk:
            {
                Walk = aSoundsList;
                break;
            }

            case eAudioM_FootSoundType.Run:
            {
                Run = aSoundsList;
                break;
            }

            case eAudioM_FootSoundType.Crouch:
            {
                Crouch = aSoundsList;
                break;
            }

            case eAudioM_FootSoundType.Crawling:
            {
                Crawl = aSoundsList;
                break;
            }
            }
        }
예제 #2
0
        public float GetVolume(eAudioM_FootSoundType aType)
        {
            switch (aType)
            {
            case eAudioM_FootSoundType.Walk:
            {
                return(m_VolumeWalk);
            }

            case eAudioM_FootSoundType.Run:
            {
                return(m_VolumeRun);
            }

            case eAudioM_FootSoundType.Crouch:
            {
                return(m_VolumeCrouch);
            }

            case eAudioM_FootSoundType.Crawling:
            {
                return(m_VolumeCrawl);
            }
            }

            return(1.0f);
        }
예제 #3
0
        public void SetVolume(float aVolume, eAudioM_FootSoundType aType)
        {
            switch (aType)
            {
            case eAudioM_FootSoundType.Walk:
            {
                m_VolumeWalk = aVolume;
                break;
            }

            case eAudioM_FootSoundType.Run:
            {
                m_VolumeRun = aVolume;
                break;
            }

            case eAudioM_FootSoundType.Crouch:
            {
                m_VolumeCrouch = aVolume;
                break;
            }

            case eAudioM_FootSoundType.Crawling:
            {
                m_VolumeCrawl = aVolume;
                break;
            }
            }
        }
예제 #4
0
        private string GetAmountOfSoundData(eAudioM_GroundType aType, eAudioM_FootSoundType aMovement)
        {
            int amount = m_FootSoundsData[(int)aType].GetSoundsList(aMovement).Count;

            if (amount >= 10)
            {
                return("[9+]");
            }
            else
            {
                return("[" + amount.ToString() + "]");
            }
        }
예제 #5
0
        private void ShowSelectGroundType()
        {
            ShowAdvancedSubtitle("All of your foot sound(s)");
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Select ground material to edit:", m_LabelTxtStyleLeft, GUILayout.Width(ScreenWidth - 126f));
            EditorGUILayout.LabelField("[w] [r] [c] [c]  ", m_LabelTxtStyleRight, GUILayout.Width(86f));
            EditorGUILayout.EndHorizontal();
            ShowGroup("", ShowMaterialAvailable);


            DrawSeparator(true);

            EditorGUILayout.LabelField("Movement type ", m_LabelTxtStyleLeft);
            m_FootSoundType = (eAudioM_FootSoundType)ShowAdvancedBtnChoice(new string[] { "Walk", "Run", "Crouch", "Crawl" }, (int)m_FootSoundType, 1);
        }
예제 #6
0
        public List <AudioClip> GetSoundsList(eAudioM_FootSoundType aType)
        {
            switch (aType)
            {
            case eAudioM_FootSoundType.Walk:
            {
                if (Walk == null)
                {
                    Walk = new List <AudioClip>();
                }
                return(Walk);
            }

            case eAudioM_FootSoundType.Run:
            {
                if (Run == null)
                {
                    Run = new List <AudioClip>();
                }
                return(Run);
            }

            case eAudioM_FootSoundType.Crouch:
            {
                if (Crouch == null)
                {
                    Crouch = new List <AudioClip>();
                }
                return(Crouch);
            }

            case eAudioM_FootSoundType.Crawling:
            {
                if (Crawl == null)
                {
                    Crawl = new List <AudioClip>();
                }
                return(Crawl);
            }
            }

            return(null);
        }
예제 #7
0
 public void PlayFootSound_Right(eAudioM_FootSoundType aType)
 {
     ManagersHUB.AudioManager.Instance.FootSound_Play(transform.position, GetGroundType(eAudioM_FootSoundDir.Right), aType, eAudioM_FootSoundDir.Right);
 }
예제 #8
0
        //--------------------------------------------------------------------------------------------

        ///<summary>
        ///(Sphere Audio) Instiante a foot sound depend on which ground you are on, play it and then destroy it
        ///<param name="aPosition">The position where the sound will be instantiate</param>
        ///<param name="aGroundType">The type of ground you are moving on</param>
        ///<param name="aMovementType">The type of movement you are doing</param>
        ///<param name="aFootDir">The foot that will touch the ground and make sound</param>
        ///</summary>
        public void FootSound_Play(Vector3 aPosition, eAudioM_GroundType aGroundType, eAudioM_FootSoundType aMovementType, eAudioM_FootSoundDir aFootDir)
        {
            if (!FootSound_IsInit(true))
            {
                return;
            }

            AudioClip clip = null;

            switch (m_FootAudioSelector)
            {
            case eAudioM_AudioSelector.AudioClip:
            {
                clip = m_FootSoundsData.GetFootSound(aGroundType, aMovementType);
                break;
            }

            case eAudioM_AudioSelector.AudioData:
            {
                AudioData data = m_FootSoundsData.GetFootSoundData(aGroundType, aMovementType);
                if (data == null)
                {
                    Debug.LogWarning(Debug_Warning("There's no AudioData available for the ground '" + aGroundType + "' and the movement type '" + aMovementType + "'"));
                    return;
                }
                data.StereoPan = FootSound_GetStereoPan(aFootDir);
                SoundEasy_Play(data, aPosition);
                return;
            }
            }

            if (clip == null)
            {
                Debug.LogWarning(Debug_Warning("There's no sound to play"));
                return;
            }

            GameObject obj = new GameObject();

            obj.transform.position = aPosition;
            SFX_AudioSetup audio = obj.AddComponent <SFX_AudioSetup>();

            audio.SetupAudio(clip, m_FootSoundsData.GetFootSoundVolume(aGroundType, aMovementType), 1.0f, 1.0f, FootSound_GetStereoPan(aFootDir));
            audio.PlayAudio(0);
        }
예제 #9
0
 public float GetFootSoundVolume(eAudioM_GroundType aGround, eAudioM_FootSoundType aType)
 {
     return(m_FootSounds[(int)aGround].GetFootSoundVolume(aType));
 }
예제 #10
0
 ///<summary>Return a foot sound data depend on the moving type of the player and the ground is on</summary>
 public AudioData GetFootSoundData(eAudioM_GroundType aGround, eAudioM_FootSoundType aType)
 {
     return(m_FootSoundsWithData[(int)aGround].GetFootSound(aType));
 }
예제 #11
0
 ///<summary>Return a foot sound depend on the moving type of the player and the ground is on</summary>
 public AudioClip GetFootSound(eAudioM_GroundType aGround, eAudioM_FootSoundType aType)
 {
     return(m_FootSounds[(int)aGround].GetFootSound(aType));
 }
예제 #12
0
        public AudioData GetFootSound(eAudioM_FootSoundType aType)
        {
            int maxRandomValue = 0;

            switch (aType)
            {
            case eAudioM_FootSoundType.Walk:
            {
                maxRandomValue = Walk.Count;
                if (maxRandomValue <= 0)
                {
                    Debug.LogWarning("There's no AudioClip for 'Walk' type in this Data!");
                    return(null);
                }
                if (Walk[0] == null)
                {
                    Debug.LogWarning("There's no AudioClip for 'Walk' type in this Data!");
                    return(null);
                }
                return(Walk[Random.Range(0, maxRandomValue)]);
            }

            case eAudioM_FootSoundType.Run:
            {
                maxRandomValue = Run.Count;
                if (maxRandomValue <= 0)
                {
                    Debug.LogWarning("There's no AudioClip for 'Run' type in this Data!");
                    return(null);
                }
                if (Run[0] == null)
                {
                    Debug.LogWarning("There's no AudioClip for 'Run' type in this Data!");
                    return(null);
                }
                return(Run[Random.Range(0, maxRandomValue)]);
            }

            case eAudioM_FootSoundType.Crouch:
            {
                maxRandomValue = Crouch.Count;
                if (maxRandomValue <= 0)
                {
                    Debug.LogWarning("There's no AudioClip for 'Crouch' type in this Data!");
                    return(null);
                }
                if (Crouch[0] == null)
                {
                    Debug.LogWarning("There's no AudioClip for 'Crouch' type in this Data!");
                    return(null);
                }
                return(Crouch[Random.Range(0, maxRandomValue)]);
            }

            case eAudioM_FootSoundType.Crawling:
            {
                maxRandomValue = Crawl.Count;
                if (maxRandomValue <= 0)
                {
                    Debug.LogWarning("There's no AudioClip for 'Crawl' type in this Data!");
                    return(null);
                }
                if (Crawl[0] == null)
                {
                    Debug.LogWarning("There's no AudioClip for 'Crawl' type in this Data!");
                    return(null);
                }
                return(Crawl[Random.Range(0, maxRandomValue)]);
            }
            }

            return(null);
        }
예제 #13
0
 public float GetFootSoundVolume(eAudioM_FootSoundType aType)
 {
     return(m_FootVolumes.GetVolume(aType));
 }
예제 #14
0
 private sVolumeFootSound ShowFootVolumes(sVolumeFootSound aVolumes, eAudioM_FootSoundType aType)
 {
     aVolumes.SetVolume(ShowAdvancedSlider(aType.ToString() + " volume", "Mute", "Max", 0.0f, 1.0f, aVolumes.GetVolume(aType), 1), aType);
     return(aVolumes);
 }