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); } }
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(); }
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); }
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(); }