本文整理汇总了C#中ParameterSet.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet.GetString方法的具体用法?C# ParameterSet.GetString怎么用?C# ParameterSet.GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterSet
的用法示例。
在下文中一共展示了ParameterSet.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RModel
public RModel(ParameterSet parm)
{
ModelInfo m;
m.modelName = parm.GetString("ModelName");
Name = m.modelName;
ShadowDrawLists = new FastList<RModelInstance>[Sun.NUM_CASCADES];
for (int i = 0; i < ShadowDrawLists.Length; i++)
ShadowDrawLists[i] = new FastList<RModelInstance>();
if (parm.HasParm("BumpMap"))
IsBumpMapped = true;
if (parm.HasParm("Shininess"))
Shininess = parm.GetFloat("Shininess");
if (parm.HasParm("SpecularPower"))
SpecularPower = parm.GetFloat("SpecularPower");
if (parm.HasParm("SpecularMap"))
IsSpecularMapped = true;
if (parm.HasParm("CastsShadows"))
CastsShadows = parm.GetBool("CastsShadows");
if (parm.HasParm("ReceivesShadows"))
ReceivesShadows = parm.GetBool("ReceivesShadows");
if (parm.HasParm("AlphaBlend"))
AlphaBlend = parm.GetBool("AlphaBlend");
m.textureName = "";
if (parm.HasParm("Texture"))
m.textureName = parm.GetString("Texture");
modelDictionary.Add(m, this);
Renderer.Instance.AddRModel(this);
}
示例2: ParseParmSet
/// <summary>
/// Read trigger specific parameters from the world parm and add them to the actor parm
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("Volume"))
actorParm.AddParm("Volume", worldParm.GetFloat("Volume"));
if (worldParm.HasParm("Pitch"))
actorParm.AddParm("Pitch", worldParm.GetFloat("Pitch"));
if (worldParm.HasParm("Pan"))
actorParm.AddParm("Pan", worldParm.GetFloat("Pan"));
if (worldParm.HasParm("Type"))
actorParm.AddParm("Type", worldParm.GetString("Type"));
System.Diagnostics.Debug.Assert(worldParm.HasParm("SoundName"), "PlaySoundTriggerVolume requires a sound name!");
actorParm.AddParm("SoundName", worldParm.GetString("SoundName"));
}
示例3: ParseParmSet
public static void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("DieOnTrigger"))
actorParm.AddParm("DieOnTrigger", worldParm.GetBool("DieOnTrigger"));
if (worldParm.HasParm("InputAction"))
actorParm.AddParm("InputAction", worldParm.GetString("InputAction"));
}
示例4: GetRModelInstance
public static RModelInstance GetRModelInstance(ParameterSet parm)
{
if (parm.HasParm("ModelType"))
if (parm.GetString("ModelType") == "Skinned")
return new SkinnedRModelInstance(parm);
return new RModelInstance(parm);
}
示例5: ParseParmSet
/// <summary>
/// Read trigger specific parameters from the world parm and add them to the actor parm
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("TextPosition"))
actorParm.AddParm("TextPosition", worldParm.GetVector2("TextPosition"));
if (worldParm.HasParm("Text"))
actorParm.AddParm("Text", worldParm.GetString("Text"));
}
示例6: ParseParmSet
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
System.Diagnostics.Debug.Assert(worldParm.HasParm("InputAction"), "ButtonPushTriggerVolume requires an input action!");
actorParm.AddParm("InputAction", worldParm.GetString("InputAction"));
if (worldParm.HasParm("KillOnButtonPush"))
actorParm.AddParm("KillOnButtonPush", worldParm.GetBool("KillOnButtonPush"));
}
示例7: CreateAnimationList
public static AnimationPlayer[] CreateAnimationList(Stage stage, ref ParameterSet parm, ref RModelInstance m)
{
SkinnedRModelInstance modelInstance = m as SkinnedRModelInstance;
AnimationPlayer[] anims = new AnimationPlayer[(int)AnimationTypes.COUNT];
if (parm.HasParm("AttackAnimation"))
anims[(int)AnimationTypes.Attack] = new AnimationPlayer(AnimationClip.LoadClip(parm.GetString("AttackAnimation")), modelInstance);
if (parm.HasParm("IdleAnimation"))
anims[(int)AnimationTypes.Idle] = new AnimationPlayer(AnimationClip.LoadClip(parm.GetString("IdleAnimation")), modelInstance);
if (parm.HasParm("DeathAnimation"))
anims[(int)AnimationTypes.Die] = new AnimationPlayer(AnimationClip.LoadClip(parm.GetString("DeathAnimation")), modelInstance);
if (parm.HasParm("WalkAnimation"))
anims[(int)AnimationTypes.Walk] = new AnimationPlayer(AnimationClip.LoadClip(parm.GetString("WalkAnimation")), modelInstance);
if (parm.HasParm("BlockAnimation"))
anims[(int)AnimationTypes.Block] = new AnimationPlayer(AnimationClip.LoadClip(parm.GetString("BlockAnimation")), modelInstance);
if (parm.HasParm("TakeDamageAnimation"))
anims[(int)AnimationTypes.TakeDamage] = new AnimationPlayer(AnimationClip.LoadClip(parm.GetString("TakeDamageAnimation")), modelInstance);
return anims;
}
示例8: switch
// position and rotation come from world parm file, which we dont have access to here
/*public PhysicsObject(PhysicsType physicsType, Model model, Vector3 position, float mass)
{
this.physicsType = physicsType;
int id = idCounter++;
if (DisableMass)
mass = -1.0f;
switch (physicsType)
{
case PhysicsType.Box:
spaceObject = PhysicsHelpers.ModelToPhysicsBox(model, position, mass);
// boxes contain a broadphase entry which is what shows up in ray casts, so we need to make sure its tag is set to the right id
// this will need to be done fore anything that is an ibroadphaseentryowner
((IBroadPhaseEntryOwner)spaceObject).Entry.Tag = id;
break;
case PhysicsType.StaticMesh:
spaceObject = PhysicsHelpers.ModelToStaticMesh(model, new BEPUphysics.MathExtensions.AffineTransform(position));
//staticmesh's are not ibroadphaseentryowners...they will turn directly on the raycast, so nothing else to set the tag on
break;
case PhysicsType.None:
spaceObject = null;
this.position = position;
return;
}
spaceObject.Tag = id;
Stage.ActiveStage.GetQB<PhysicsQB>().Space.Add(spaceObject);
}*/
/// <summary>
/// Create a physics object
/// </summary>
/// <param name="actor">Actor that we are attached to</param>
/// <param name="Parm">Actor's parm file</param>
/// <param name="model">Actors model (so we can size the collider)</param>
/// <param name="position">Position (from world parm)</param>
/// <param name="rotation">Rotation (from world parm)</param>
public PhysicsObject(Actor actor, ParameterSet Parm, Model model, Vector3 position, Vector3 rotation, Stage stage)
{
// **rotation comes in from file as ( pitch, yaw, roll )**
this.actor = actor;
this.physicsType = GameLib.PhysicsObject.PhysicsTypeFromString(Parm.GetString("PhysicsType"));
this.position = position;
this.rotation = Matrix.CreateFromYawPitchRoll(rotation.Y, rotation.X, rotation.Z);
if (ForceStaticMesh)
this.physicsType = PhysicsType.StaticMesh;
switch (this.physicsType)
{
case PhysicsType.Box:
{
float mass;
if (DisableMass)
mass = -1.0f;
else
mass = Parm.GetFloat("Mass");
BEPUphysics.Entities.Entity entity = PhysicsHelpers.ModelToPhysicsBox(model, position, mass, rotation.X, rotation.Y, rotation.Z);
entity.CollisionInformation.OwningActor = actor;
spaceObject = entity;
break;
}
case PhysicsType.StaticMesh:
BEPUphysics.Collidables.StaticMesh mesh = PhysicsHelpers.ModelToStaticMesh(model, new BEPUphysics.MathExtensions.AffineTransform(Quaternion.CreateFromRotationMatrix( this.rotation ), position));
mesh.OwningActor = actor;
spaceObject = mesh;
break;
case PhysicsType.Character:
{
float mass = Parm.GetFloat("Mass");
float scaleRadius = 1.0f;
if (Parm.HasParm("ScaleRadius"))
scaleRadius = Parm.GetFloat("ScaleRadius");
characterController = PhysicsHelpers.ModelToCharacterController(model, position, mass, scaleRadius);
spaceObject = characterController.Body;
characterController.Body.CollisionInformation.OwningActor = actor;
stage.GetQB<PhysicsQB>().AddToSpace(CharacterController);
return;
}
case PhysicsType.CylinderCharacter:
{
float mass = Parm.GetFloat("Mass");
float scaleRadius = 1.0f;
if (Parm.HasParm("ScaleRadius"))
scaleRadius = Parm.GetFloat("ScaleRadius");
if (Parm.HasParm("ColliderDims"))
{
Vector2 v = Parm.GetVector2("ColliderDims");
cylinderCharController = new CylinderCharacterController(position, v.Y, v.X, mass);
}
else
cylinderCharController = PhysicsHelpers.ModelToCylinderCharacterController(model, position, mass, scaleRadius);
cylinderCharController.Body.Orientation = Quaternion.CreateFromYawPitchRoll(rotation.Y, rotation.X, rotation.Z);
spaceObject = cylinderCharController.Body;
cylinderCharController.Body.CollisionInformation.OwningActor = actor;
stage.GetQB<PhysicsQB>().AddToSpace(cylinderCharController);
return;
}
//.........这里部分代码省略.........
示例9: PostLoadInit
public override void PostLoadInit(ParameterSet Parm)
{
int index = 0;
while (Parm.HasParm("Light" + index))
{
string keyString = "Light" + index;
string lightType = Parm.GetString(keyString);
switch (lightType)
{
case "Directional":
{
// read directional light parameters and create light
Vector3 direction = Parm.GetVector3(keyString + "Direction");
Vector4 color = Parm.GetVector4(keyString + "Color");
float intensity = Parm.GetFloat(keyString + "Intensity");
directionalLights.Add(new DirectionalLight(direction, color, intensity));
}
break;
case "Spot":
{
Vector3 position = Parm.GetVector3(keyString + "Position");
Vector3 direction = Parm.GetVector3(keyString + "Direction");
Vector4 color = Parm.GetVector4(keyString + "Color");
float intensity = Parm.GetFloat(keyString + "Intensity");
spotLights.Add(new SpotLight(DeferredRenderer.Instance.GraphicsDevice, position, direction, color, intensity, true, 1024, spotCookie));
}
break;
case "Point":
{
Vector3 position = Parm.GetVector3(keyString + "Position");
float radius = Parm.GetFloat(keyString + "Radius");
Vector4 color = Parm.GetVector4(keyString + "Color");
float intensity = Parm.GetFloat(keyString + "Intensity");
pointLights.Add(new PointLight(DeferredRenderer.Instance.GraphicsDevice, position, radius, color, intensity, true, 256));
}
break;
}
index++;
}
}
示例10: PreLoadInit
public override void PreLoadInit(ParameterSet Parm)
{
if (Parm.HasParm("FirstScreen"))
{
Initialize(Parm.GetString("FirstScreen"));
}
}
示例11: PreLoadInit
public override void PreLoadInit(ParameterSet Parm)
{
setupCollisionGroups();
if (Parm.HasParm("Gravity"))
{
string[] gravity = Parm.GetString("Gravity").Split();
float x = float.Parse(gravity[0], System.Globalization.CultureInfo.InvariantCulture);
float y = float.Parse(gravity[1], System.Globalization.CultureInfo.InvariantCulture);
float z = float.Parse(gravity[2], System.Globalization.CultureInfo.InvariantCulture);
Space.ForceUpdater.Gravity = new Vector3(x, y, z);
}
}
示例12: ParseParmSet
/// <summary>
/// Read trigger specific parameters from the world parm and add them to the actor parm
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
//check for the bare minimum required parms
System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerInput0"), "TutorialStopTriggerVolume requires a ControllerInput0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarInput0"), "TutorialStopTriggerVolume requires a GuitarInput0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerImage0"), "TutorialStopTriggerVolume requires a ControllerImage0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarImage0"), "TutorialStopTriggerVolume requires a GuitarImage0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerImagePos0"), "TutorialStopTriggerVolume requires a ControllerImagePos0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerImageSize0"), "TutorialStopTriggerVolume requires a ControllerImageSize0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarImagePos0"), "TutorialStopTriggerVolume requires a GuitarImagePos0!");
System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarImageSize0"), "TutorialStopTriggerVolume requires a GuitarImageSize0!");
int count = 0;
while (worldParm.HasParm("ControllerInput"+count))
{
actorParm.AddParm("ControllerInput"+count, worldParm.GetString("ControllerInput"+count));
actorParm.AddParm("GuitarInput"+count, worldParm.GetString("GuitarInput"+count));
actorParm.AddParm("ControllerImage"+count, worldParm.GetString("ControllerImage"+count));
actorParm.AddParm("GuitarImage"+count, worldParm.GetString("GuitarImage"+count));
actorParm.AddParm("ControllerImagePos"+count, worldParm.GetString("ControllerImagePos"+count));
actorParm.AddParm("ControllerImageSize"+count, worldParm.GetString("ControllerImageSize"+count));
actorParm.AddParm("GuitarImagePos"+count, worldParm.GetString("GuitarImagePos"+count));
actorParm.AddParm("GuitarImageSize"+count, worldParm.GetString("GuitarImageSize"+count));
//optional parms
if (worldParm.HasParm("StrumRequired"+count))
actorParm.AddParm("StrumRequired"+count, worldParm.GetBool("StrumRequired"+count));
if (worldParm.HasParm("AllInputsRequired"+count))
actorParm.AddParm("AllInputsRequired"+count, worldParm.GetBool("AllInputsRequired"+count));
if (worldParm.HasParm("SpawnEnemy"+count))
actorParm.AddParm("SpawnEnemy"+count, worldParm.GetBool("SpawnEnemy"+count));
if (worldParm.HasParm("KillEnemies"+count))
actorParm.AddParm("KillEnemies"+count, worldParm.GetBool("KillEnemies"+count));
if (worldParm.HasParm("TriggerDelay"+count))
actorParm.AddParm("TriggerDelay"+count, worldParm.GetFloat("TriggerDelay"+count));
count++;
}
if (worldParm.HasParm("EndLevel"))
actorParm.AddParm("EndLevel", worldParm.GetBool("EndLevel"));
actorParm.AddParm("Num", count);
}
示例13: ParseParmSet
/// <summary>
/// Read trigger specific parameters from the world parm and add them to the actor parm
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("Count"))
actorParm.AddParm("Count", worldParm.GetInt("Count"));
if (worldParm.HasParm("Freq"))
actorParm.AddParm("Freq", worldParm.GetFloat("Freq"));
if (worldParm.HasParm("SpawnInWaves"))
actorParm.AddParm("SpawnInWaves", worldParm.GetBool("SpawnInWaves"));
if (worldParm.HasParm("DelayForFirst"))
actorParm.AddParm("DelayForFirst", worldParm.GetFloat("DelayForFirst"));
if (worldParm.HasParm("ConstantSpawns"))
actorParm.AddParm("ConstantSpawns", worldParm.GetBool("ConstantSpawns"));
if (worldParm.HasParm("EnemyList"))
actorParm.AddParm("EnemyList", worldParm.GetBool("EnemyList"));
System.Diagnostics.Debug.Assert(worldParm.HasParm("ActorType"), "SpawnActorTriggerVolume requires an actor type to spawn!");
actorParm.AddParm("ActorType", worldParm.GetString("ActorType"));
System.Diagnostics.Debug.Assert(worldParm.HasParm("SpawnPos"), "SpawnActorTriggerVolume requires a position to spawn at!");
actorParm.AddParm("SpawnPos", worldParm.GetString("SpawnPos"));
}
示例14: CreateRModel
private static RModel CreateRModel(ParameterSet parm)
{
// if we have a model type, read it and create the right rmodel type
if (parm.HasParm("ModelType"))
{
switch (parm.GetString("ModelType"))
{
case "Skinned":
return new SkinnedRModel(parm);
case "Static":
return new StaticRModel(parm);
case "Water":
return new WaterRModel(parm);
case "EditorManipulator":
return new EditorManipulatorRModel(parm);
default:
System.Diagnostics.Debug.Assert(false, "Invalid model type: " + parm.GetString("ModelType"));
break;
}
}
// default to static
return new StaticRModel(parm);
}
示例15: BasicModelLoad
// used by skinnedrmodel, staticrmodel, waterrmodel to load basic parameters
protected Model BasicModelLoad(ParameterSet parm, out bool initialized)
{
Microsoft.Xna.Framework.Graphics.Model model = Renderer.Instance.LookupModel("Models/" + Name, out initialized);
diffuse = null;
bumpMap = null;
specularMap = null;
if (parm.HasParm("Texture"))
diffuse = Renderer.Instance.LookupTexture("Models/" + parm.GetString("Texture"));
else
diffuse = Renderer.Instance.LookupTexture("DefaultDiffuse");
if (IsBumpMapped)
bumpMap = Renderer.Instance.LookupTexture("Models/" + parm.GetString("BumpMap"));
if (IsSpecularMapped)
specularMap = Renderer.Instance.LookupTexture("Models/" + parm.GetString("SpecularMap"));
return model;
}