本文整理汇总了C#中ParameterSet.HasParm方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet.HasParm方法的具体用法?C# ParameterSet.HasParm怎么用?C# ParameterSet.HasParm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterSet
的用法示例。
在下文中一共展示了ParameterSet.HasParm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseParmSet
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
if (worldParm.HasParm("Strength"))
actorParm.AddParm("Strength", worldParm.GetFloat("Strength"));
if (worldParm.HasParm("Direction"))
actorParm.AddParm("Direction", worldParm.GetVector3("Direction"));
}
示例2: 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"));
}
示例3: 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"));
}
示例4: 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"));
}
示例5: ParseParmSet
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm)
{
System.Diagnostics.Debug.Assert(worldParm.HasParm("NewDir"), "Rotate Camera requires a new direction!");
actorParm.AddParm("NewDir", worldParm.GetVector3("NewDir"));
if (worldParm.HasParm("RotateRight"))
actorParm.AddParm("RotateRight", worldParm.GetBool("RotateRight"));
if(worldParm.HasParm("RotationTime"))
actorParm.AddParm("RotationTime", worldParm.GetFloat("RotationTime"));
}
示例6: 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);
}
示例7: 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"));
}
示例8: Sun
public Sun(ParameterSet parm)
{
if (parm.HasParm("SunColor"))
lightColor = parm.GetVector4("SunColor");
if (parm.HasParm("AmbientLightColor"))
ambientLightColor = parm.GetVector4("AmbientLightColor");
Vector2 sunAngles = Vector2.Zero;
if (parm.HasParm("SunAngles"))
sunAngles = parm.GetVector2("SunAngles");
if ( shadowMap == null )
shadowMap = new RenderTarget2D(Renderer.Instance.GraphicsDevice, SHADOW_MAP_WIDTH_HEIGHT * NUM_CASCADES, SHADOW_MAP_WIDTH_HEIGHT, false, SurfaceFormat.Single, DepthFormat.Depth24);
SetSunDirectionFromSphericalCoords(sunAngles.X, sunAngles.Y);
}
示例9: GetRModelInstance
public static RModelInstance GetRModelInstance(ParameterSet parm)
{
if (parm.HasParm("ModelType"))
if (parm.GetString("ModelType") == "Skinned")
return new SkinnedRModelInstance(parm);
return new RModelInstance(parm);
}
示例10: InitEnemyPools
private void InitEnemyPools(ref ParameterSet Parm)
{
availableWeakAI = new LinkedList<AI>();
availableRangedAI = new LinkedList<AI>();
availableHeavyAI = new LinkedList<AI>();
//add the number of enemies in the file
Vector3 zero = Vector3.Zero;
int num;
if (Parm.HasParm("EnemyWeakPoolSize"))
num = Parm.GetInt("EnemyWeakPoolSize");
else num = 0;
for(int i = 0; i < num; i++)
PreLoad("EnemyWeak", ref zero, ref zero);
if (Parm.HasParm("EnemyRangedPoolSize"))
num = Parm.GetInt("EnemyRangedPoolSize");
else num = 0;
for (int i = 0; i < num; i++)
PreLoad("EnemyRanged", ref zero, ref zero);
if (Parm.HasParm("EnemyHeavyPoolSize"))
num = Parm.GetInt("EnemyHeavyPoolSize");
else num = 0;
for(int i = 0; i < num; i++)
PreLoad("EnemyHeavy", ref zero, ref zero);
ShutdownAll();
}
示例11: 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;
}
示例12: Convert
public void Convert(ref ParameterSet parm)
{
if (parm.HasParm("Health"))
startingHealth = this.health = parm.GetFloat("Health");
switch (actor.Name)
{
case "EnemyWeak":
if (Stage.ActiveStage.Parm.HasParm("AIWeakHealthScalar"))
health *= Stage.ActiveStage.Parm.GetFloat("AIWeakHealthScalar");
break;
case "EnemyRanged":
if (Stage.ActiveStage.Parm.HasParm("AIRangedHealthScalar"))
health *= Stage.ActiveStage.Parm.GetFloat("AIRangedHealthScalar");
break;
case "EnemyHeavy":
if (Stage.ActiveStage.Parm.HasParm("AIHeavyHealthScalar"))
health *= Stage.ActiveStage.Parm.GetFloat("AIHeavyHealthScalar");
break;
}
infiniteHealth = false;
startsWithShield = shielded = false;
percDamageAbsorbedByShield = 0;
numHitsForDisarm = 0;
if (parm.HasParm("InfiniteHealth"))
infiniteHealth = parm.GetBool("InfiniteHealth");
if (parm.HasParm("Shielded"))
startsWithShield = this.shielded = parm.GetBool("Shielded");
if (parm.HasParm("ShieldDmgAbsorbPerc"))
this.percDamageAbsorbedByShield = parm.GetFloat("ShieldDmgAbsorbPerc");
if (parm.HasParm("ShutdownInsteadOfKill"))
shutdownInsteadOfKill = parm.GetBool("ShutdownInsteadOfKill");
if (parm.HasParm("NumHitsForDisarm"))
numHitsForDisarm = startingHitsForDisarm = parm.GetInt("NumHitsForDisarm");
}
示例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: PostLoadInit
public void PostLoadInit(ParameterSet parm)
{
Green = input.GetInputAction("A");
Red = input.GetInputAction("B");
PauseGame = input.GetInputAction("IsPauseGame");
MenuSelect = input.GetInputAction("IsMenuSelect");
MenuCancel = input.GetInputAction("IsMenuCancel");
MenuUp = input.GetInputAction("IsMenuUp");
MenuDown = input.GetInputAction("IsMenuDown");
MenuRight = input.GetInputAction("IsMenuRight");
MenuLeft = input.GetInputAction("IsMenuLeft");
if (parm.HasParm("DontPause"))
dontPause = parm.GetBool("DontPause");
}
示例15: 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++;
}
}