Ejemplo n.º 1
0
        public void Update(SoundObject soundObj, SoundEffectInstance inst)
        {
            inst.Volume = soundObj.Volume;

            if (Type == SoundType.World || Type == SoundType.Global)
            {
                SoundEffect.DistanceScale = soundObj.Radius;
                inst.Apply3D(listener, soundObj.Emitter);
            }
        }
Ejemplo n.º 2
0
        public SoundEffectInstance Play(SoundEffectPart category, SoundObject soundObj)
        {
            switch (Type)
            {
            case SoundType.Normal:
                return(Play(category, soundObj.Volume));

            case SoundType.Player:
                if (soundObj.Parent.IsLocalHumanPlayer)
                {
                    return(Play(category, soundObj.Volume));
                }
                return(null);

            case SoundType.Global:
            case SoundType.World:
                return(Play3D(category, soundObj.Emitter));
            }
            throw new NotSupportedException();
        }
Ejemplo n.º 3
0
        public void Parse(ConfigurationSection sect)
        {
            float lng = sect.GetSingle("Longitude");
            float lat = sect.GetSingle("Latitude");
            lng = MathEx.Degree2Radian(lng);
            lat = MathEx.Degree2Radian(lat);

            float alt = TerrainData.Instance.QueryHeight(lng, lat);

            position = PlanetEarth.GetPosition(lng, lat);

            radius = sect.GetSingle("Radius");

            radius = PlanetEarth.GetTileHeight(MathEx.Degree2Radian(radius));

            string sfxName = sect["SFX"];

            sound = SoundManager.Instance.MakeSoundObjcet(sfxName, null, radius);
            sound.Position = position;

            //probability = sect.GetSingle("Probability", 1);
        }
Ejemplo n.º 4
0
        public void Parse(ConfigurationSection sect)
        {
            float lng = sect.GetSingle("Longitude");
            float lat = sect.GetSingle("Latitude");

            lng = MathEx.Degree2Radian(lng);
            lat = MathEx.Degree2Radian(lat);

            float alt = TerrainData.Instance.QueryHeight(lng, lat);

            position = PlanetEarth.GetPosition(lng, lat);

            radius = sect.GetSingle("Radius");

            radius = PlanetEarth.GetTileHeight(MathEx.Degree2Radian(radius));

            string sfxName = sect["SFX"];

            sound          = SoundManager.Instance.MakeSoundObjcet(sfxName, null, radius);
            sound.Position = position;

            //probability = sect.GetSingle("Probability", 1);
        }
Ejemplo n.º 5
0
 public SoundEffectInstance Play(SoundEffectPart category, SoundObject soundObj)
 {
     switch (Type)
     {
         case SoundType.Normal:
             return Play(category, soundObj.Volume);
         case SoundType.Player:
             if (soundObj.Parent.IsLocalHumanPlayer)
             {
                 return Play(category, soundObj.Volume);
             }
             return null;
         case SoundType.Global:
         case SoundType.World:
             return Play3D(category, soundObj.Emitter);
     }
     throw new NotSupportedException();
 }
Ejemplo n.º 6
0
        public void Update(SoundObject soundObj, SoundEffectInstance inst)
        {
            inst.Volume = soundObj.Volume;

            if (Type == SoundType.World || Type == SoundType.Global)
            {
                SoundEffect.DistanceScale = soundObj.Radius;
                inst.Apply3D(listener, soundObj.Emitter);
            }
        }