示例#1
0
    private void _ApplyVolumeChange()
    {
        // TODO: change Volume into a property and call ApplyVolumeChange automatically (requires editor inspector adaption!)

        AudioObject[] objs = RegisteredComponentController.GetAllOfType <AudioObject>();

        foreach (AudioObject o in objs)
        {
            if (o.category == this)
            {
                //if ( o.IsPlaying() )
                {
                    o._ApplyVolume();
                }
            }
        }
    }
示例#2
0
    static public List <string> GetUsedAudioClipNames()
    {
        matchesListString.Clear();

        object[] objs = RegisteredComponentController.GetAllOfType(typeof(SoundObject));
        for (int i = 0; i < objs.Length; i++)
        {
            var sound = objs[i] as SoundObject;
            if (sound.IsPlaying || sound.IsPaused)
            {
                if (sound.SubItem.SubItemType == SoundClipType.StreamingClip)
                {
                    matchesListString.Add(sound.SubItem.Name);
                }
            }
        }

        return(matchesListString);
    }
示例#3
0
    public static SoundObject[] GetPlayingAudioObjects(string soundID, bool includePausedAudio = false)
    {
        matchesList.Clear();

        object[] objs = RegisteredComponentController.GetAllOfType(typeof(SoundObject));
        for (int i = 0; i < objs.Length; i++)
        {
            var sound = objs[i] as SoundObject;
            if (sound.IsPlaying || (includePausedAudio && sound.IsPaused))
            {
                if (string.IsNullOrEmpty(soundID) || sound.SoundID.Equals(soundID))
                {
                    matchesList.Add(sound);
                }
            }
        }

        return(matchesList.ToArray());
    }