void ISerializationCallbackReceiver.OnAfterDeserialize() { //cgme_lib = CGME.CGLibrary.GetInstance(); cgme_lib.resourceLibrary.Clear(); foreach (SerialNode snode in lib_node.resources) { CGME.Resource new_res = CGME.CGFactory.CreateCGInstance(snode.type_string) as CGME.Resource; new_res.Read(snode.data); cgme_lib.resourceLibrary.Add(new_res); } foreach (SerialNode snode in lib_node.cards) { CGME.Card new_card = new CGME.Card(); new_card.Read(snode.data); cgme_lib.CardsLibrary.Add(new_card); } foreach (ActionWrapper action_wrapper in actions) { action_wrapper.OnAfterDeserialize(); } }
public void OnAfterDeserialize() { if (node == null || CGME_resource != null) { return; } CGME.Resource new_res = null; new_res = CGME.CGFactory.CreateCGInstance(node.type_string) as CGME.Resource; if (new_res != null) { CGME_resource = new_res; CGME_resource.Read(node.data); } new_res = null; }