public override void Serialize(ParameterSet parm) { int index = 0; foreach (Actor trigger in triggers) { TriggerVolume triggerVolume = trigger.agents[0] as TriggerVolume; // shouldn't be any other agents attached... parm.SetPrefix("TriggerVolume" + index); parm.AddParm("", triggerVolume.Name); parm.AddParm("Position", trigger.PhysicsObject.Position); parm.AddParm("ModelName", trigger.modelInstance.model.Name); triggerVolume.Serialize(ref parm); // trigger type specific parameters parm.ClearPrefix(); index++; } }