Ejemplo n.º 1
0
        private static bool LoggingEnabledForGroup(MasterAudioGroup grp) {
            if (IsWarming) {
                return false;
            }

            if (Instance.disableLogging) {
                return false;
            }

            if (grp != null && grp.logSound) {
                return true;
            }

            return Instance.LogSounds;
        }
Ejemplo n.º 2
0
 public AudioGroupInfo(List<AudioInfo> sources, MasterAudioGroup groupScript) {
     Sources = sources;
     LastFramePlayed = -50;
     LastTimePlayed = -50;
     Group = groupScript;
     PlayedForWarming = false;
 }
Ejemplo n.º 3
0
        private static void SetGroupMuteStatus(MasterAudioGroup aGroup, string sType, bool isMute) {
            aGroup.isMuted = isMute;

            var theGroup = AudioSourcesBySoundType[sType];
            // ReSharper disable TooWideLocalVariableScope
            AudioInfo aInfo;
            AudioSource aSource;
            // ReSharper restore TooWideLocalVariableScope

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var i = 0; i < theGroup.Sources.Count; i++) {
                aInfo = theGroup.Sources[i];
                aSource = aInfo.Source;

                aSource.mute = isMute;
            }
        }
Ejemplo n.º 4
0
        /*! \endcond */

        /// <summary>
        /// This method will return the bus volume of a specified Sound Group, if any. If the Group is not in a bus, this will return 1.
        /// </summary>
        /// <param name="maGroup">The Sound Group object.</param>
        /// <returns>The volume of the bus.</returns>
        public static float GetBusVolume(MasterAudioGroup maGroup) {
            var busVolume = 1f;
            if (maGroup.busIndex >= HardCodedBusOptions) {
                busVolume = GroupBuses[maGroup.busIndex - HardCodedBusOptions].volume;
            }

            return busVolume;
        }
Ejemplo n.º 5
0
        /*! \endcond */

        private static void RescanChildren(MasterAudioGroup group) {
            var newChildren = new List<SoundGroupVariation>();

            var childNames = new List<string>();

            for (var i = 0; i < group.transform.childCount; i++) {
                var child = group.transform.GetChild(i);

                if (childNames.Contains(child.name)) {
                    continue;
                }

                childNames.Add(child.name);

                var variation = child.GetComponent<SoundGroupVariation>();

                newChildren.Add(variation);
            }

            group.groupVariations = newChildren;
        }