public void OnLoad(ConfigNode configNode) { name = ConfigNodeUtil.ParseValue <string>(configNode, "name"); aspectRatio = ConfigNodeUtil.ParseValue <float>(configNode, "aspectRatio"); foreach (ConfigNode child in configNode.GetNodes()) { Type nodeType = ConfigNodeUtil.ParseTypeValue(child.name); if (nodeType.IsSubclassOf(typeof(CutSceneCamera))) { CutSceneCamera cameraDefinition = Activator.CreateInstance(nodeType) as CutSceneCamera; cameraDefinition.OnLoad(child); cameras.Add(cameraDefinition); } else if (nodeType.IsSubclassOf(typeof(Actor))) { Actor actor = Activator.CreateInstance(nodeType) as Actor; actor.OnLoad(child); actors.Add(actor); } else if (nodeType.IsSubclassOf(typeof(CutSceneAction))) { CutSceneAction action = Activator.CreateInstance(nodeType) as CutSceneAction; action.cutSceneDefinition = this; action.OnLoad(child); actions.Add(action); } else { LoggingUtil.LogError(this, "Couldn't load CutSceneDefinition - unknown type '{0}'.", child.name); } } }