本文整理汇总了C#中ParameterSet.AddParm方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet.AddParm方法的具体用法?C# ParameterSet.AddParm怎么用?C# ParameterSet.AddParm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterSet
的用法示例。
在下文中一共展示了ParameterSet.AddParm方法的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: Serialize
public override void Serialize(ref ParameterSet parm)
{
parm.AddParm("InputAction", inputAction.name);
parm.AddParm("KillOnButtonPush", killOnButtonPush);
base.Serialize(ref parm);
}
示例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: Serialize
public override void Serialize(ref ParameterSet parm)
{
parm.AddParm("NewDir", newForwardDir);
parm.AddParm("RotateRight", rotateRight);
parm.AddParm("RotationTime", rotationTime);
base.Serialize(ref 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: 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"));
}
示例8: 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"));
}
示例9: defaultParameters
private ParameterSet defaultParameters(ParameterSet old)
{
ParameterSet newParm = new ParameterSet();
foreach (KeyValuePair<string, string> kv in old)
{
if (kv.Key == "ModelName" || kv.Key == "Mass" || kv.Key == "PhysicsType")
newParm.AddParm(kv.Key, kv.Value);
}
return newParm;
}
示例10: 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"));
}
示例11: CreateTrigger
public void CreateTrigger(string triggerType)
{
TriggerQB triggerQB = Stage.ActiveStage.GetQB<TriggerQB>();
ParameterSet parm = new ParameterSet();
parm.AddParm("AssetName", "TriggerVolume" + triggerQB.triggers.Count);
parm.AddParm("ModelName", "TriggerVolume");
parm.AddParm("Mass", -1.0f);
parm.AddParm("PhysicsType", "TriggerVolume");
parm.AddParm("Agents", triggerType);
switch (triggerType)
{
case "PlaySoundTriggerVolume":
parm.AddParm("SoundName", "guitarslide");
break;
case "SpawnActorTriggerVolume":
parm.AddParm("ActorType", "EnemyWeak");
parm.AddParm("SpawnPos", Vector3.Zero);
parm.AddParm("Count", 1);
parm.AddParm("Freq", 1.0f);
parm.AddParm("DelayForFirst", 0.0f);
parm.AddParm("SpawnInWaves", false);
parm.AddParm("DelayForFirst",0);
parm.AddParm("ConstantSpawns",false);
parm.AddParm("EnemyList",false);
break;
case "RotateCameraTriggerVolume":
parm.AddParm("NewDir", Vector3.Forward);
break;
}
Vector3 pos = CameraQB.WorldMatrix.Translation + CameraQB.WorldMatrix.Forward * 30.0f;
triggerQB.AddTrigger(parm, pos);
}
示例12: SaveStage
public void SaveStage(string filename)
{
worldFile = filename;
//create an empty ParameterSet
ParameterSet newParms = new ParameterSet();
// add the asset name (world filename without extension)
newParms.AddParm("AssetName", System.IO.Path.GetFileNameWithoutExtension(worldFile));
if (parms.HasParm("SunAngles"))
newParms.AddParm("SunAngles", parms.GetVector2("SunAngles")); // in need a better solution
// add the quarterback list to the parm set
string qbs = "";
foreach (KeyValuePair<System.Type, Quarterback> qb in Stage.ActiveStage.QBTable)
{
//check if this is the first addition to the quarterbacks string
qbs += qb.Value.Name() + ',';
}
qbs = qbs.Remove(qbs.Length - 1); // remove the last comma
//add the qbs to the Quarterbacks key
newParms.AddParm("Quarterbacks", qbs);
foreach (KeyValuePair<System.Type, Quarterback> qb in Stage.ActiveStage.QBTable)
{
//serialize the current quarterback
qb.Value.Serialize(newParms);
}
//set parms to newParms
parms = newParms;
//write file
parms.ToFile(worldFile);
}
示例13: Serialize
public override void Serialize(ParameterSet parm)
{
//TODO::
//figure out what needs to be updated here
if (levelTheme != null)
parm.AddParm("SoundTheme", levelThemeString);
int index = 0;
foreach( string key in soundsLib.Keys)
{
parm.AddParm("Sound" + index++, key);
}
}
示例14: Serialize
public override void Serialize(ParameterSet parm)
{
parm.AddParm("FirstScreen", firstScreenName);
}
示例15: 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);
}