// TRIGGER public void Serialize(EntityPropsTrigger entity_props, JObject root) { for (int i = 0; i < EntityPropsTrigger.MAX_LINKS; i++) { root["entity_link" + i.ToString()] = entity_props.entity_link[i].ToString(); } root["onetime"] = entity_props.one_time.ToString(); root["repeat_delay"] = entity_props.repeat_delay.ToString(); root["player_weapons"] = entity_props.player_weapons.ToString(); #if !OVERLOAD_LEVEL_EDITOR root["size"] = entity_props.size.ToOpenTK().Serialize(); #else root["size"] = entity_props.size.Serialize(); #endif }
public void Deserialize(EntityPropsTrigger entity_props, JObject root) { for (int i = 0; i < EntityPropsTrigger.MAX_LINKS; i++) { entity_props.entity_link[i] = root["entity_link" + i.ToString()].GetEntityGuid(); #if OVERLOAD_LEVEL_EDITOR Utility.DebugLog("Trigger Deserialize " + root["entity_link" + i.ToString()] + " converted to " + entity_props.entity_link[i]); #endif } entity_props.one_time = root["onetime"].GetBool(); entity_props.repeat_delay = root["repeat_delay"].GetFloat(); entity_props.player_weapons = root["player_weapons"].GetBool(); #if !OVERLOAD_LEVEL_EDITOR entity_props.size = root["size"].GetVector3().ToUnity(); #else entity_props.size = root["size"].GetVector3(); #endif }