本文整理汇总了C#中ConfigurationSection.GetSingle方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationSection.GetSingle方法的具体用法?C# ConfigurationSection.GetSingle怎么用?C# ConfigurationSection.GetSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationSection
的用法示例。
在下文中一共展示了ConfigurationSection.GetSingle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
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);
}
示例2: MapSceneObject
public MapSceneObject(ConfigurationSection sect)
{
Radius = sect.GetSingle("Radius", 0);
IsForest = sect.GetBool("IsForest", false);
Amount = sect.GetSingle("Amount", 0);
Model = sect.GetString("Model", string.Empty);
}
示例3: SoundEffectGame
public SoundEffectGame(AudioListener listener, SoundManager sm, ConfigurationSection sect)
{
this.contentManager = sm.Content;
this.listener = listener;
string[] control = sect.GetStringArray("Control");
for (int i = 0; i < control.Length; i++)
{
control[i] = control[i].ToLowerInvariant();
switch (control[i])
{
case "loop":
Control |= SoundControl.Loop;
break;
case "random":
Control |= SoundControl.Random;
break;
case "ambient":
Control |= SoundControl.Ambient;
break;
}
}
Probability = sect.GetSingle("Probability", 1);
Volume = sect.GetSingle("Volume", 1);
Type = (SoundType)Enum.Parse(typeof(SoundType), sect.GetString("Type", SoundType.Normal.ToString()), true);
//this.soundEffect = contentManager.Load<SoundEffect>(sect.Name);
soundEffects = new SoundEffect[3][];
if ((Control & SoundControl.Loop) == SoundControl.Loop)
{
string[] fadein = sect.GetStringArray("Fadein");
soundEffects[(int)SoundEffectPart.Fadein] = new SoundEffect[fadein.Length];
for (int index = 0; index < fadein.Length; index++)
{
soundEffects[(int)SoundEffectPart.Fadein][0] = contentManager.Load<SoundEffect>(fadein[index]);
}
string[] mediumstring = sect.GetStringArray("Medium");
soundEffects[(int)SoundEffectPart.Medium] = new SoundEffect[mediumstring.Length];
for (int index = 0; index < mediumstring.Length; index++)
{
soundEffects[(int)SoundEffectPart.Medium][index] = contentManager.Load<SoundEffect>(mediumstring[index]);
}
string[] fadeout = sect.GetStringArray("Fadeout");
soundEffects[(int)SoundEffectPart.Fadeout] = new SoundEffect[fadeout.Length];
for (int index = 0; index < fadein.Length; index++)
{
soundEffects[(int)SoundEffectPart.Fadeout][0] = contentManager.Load<SoundEffect>(fadeout[index]);
}
}
else
{
string[] sounds = sect.GetStringArray("Sounds");
soundEffects[(int)SoundEffectPart.Fadein] = new SoundEffect[sounds.Length];
for (int i = 0; i < sounds.Length; i++)
{
soundEffects[0][i] = contentManager.Load<SoundEffect>(sounds[i]);
}
soundEffects[1] = soundEffects[0];
soundEffects[2] = soundEffects[0];
}
}
示例4: MapSoundObject
public MapSoundObject(ConfigurationSection sect)
{
Radius = sect.GetSingle("Radius", 0);
SFXName = sect.GetString("SFX", string.Empty);
}