/// <summary> /// Called when deserializing /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected TriggerBoxShape(SerializationInfo info, StreamingContext context) : base(info, context) { _vBoxSize = (Vector3F)info.GetValue("_vBoxSize", typeof(Vector3F)); RemoveHint(HintFlags_e.NoRotation); _bDestroyOnTrigger = info.GetBoolean("_bDestroyOnTrigger"); _iObserverFlags = (TriggerBoxObserverFlags_e)info.GetValue("_iObserverFlags", typeof(TriggerBoxObserverFlags_e)); if (SerializationHelper.HasElement(info, "_bEnabled")) { _bEnabled = info.GetBoolean("_bEnabled"); } if (SerializationHelper.HasElement(info, "_previewColor")) { _previewColor = (Color)info.GetValue("_previewColor", typeof(Color)); } if (SerializationHelper.HasElement(info, "_bPreview2D")) { _bPreview2D = info.GetBoolean("_bPreview2D"); } if (SerializationHelper.HasElement(info, "_bPreview3D")) { _bPreview3D = info.GetBoolean("_bPreview3D"); } if (SerializationHelper.HasElement(info, "_shapeType")) { _shapeType = (TriggerShape_e)info.GetValue("_shapeType", typeof(TriggerShape_e)); } // backwards compatibility if (!SerializationHelper.HasElement(info, "SupportScaling")) { SetScaling_Internal(1.0f, 1.0f, 1.0f); } }
/// <summary> /// Called when deserializing /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected TriggerBoxShape(SerializationInfo info, StreamingContext context) : base(info, context) { _vBoxSize = (Vector3F)info.GetValue( "_vBoxSize", typeof(Vector3F) ); RemoveHint(HintFlags_e.NoRotation); _bDestroyOnTrigger = info.GetBoolean("_bDestroyOnTrigger"); _iObserverFlags = (TriggerBoxObserverFlags_e)info.GetValue("_iObserverFlags", typeof(TriggerBoxObserverFlags_e)); if (SerializationHelper.HasElement(info, "_bEnabled")) _bEnabled = info.GetBoolean("_bEnabled"); if (SerializationHelper.HasElement(info, "_previewColor")) _previewColor = (Color)info.GetValue("_previewColor", typeof(Color)); if (SerializationHelper.HasElement(info, "_bPreview2D")) _bPreview2D = info.GetBoolean("_bPreview2D"); if (SerializationHelper.HasElement(info, "_bPreview3D")) _bPreview3D = info.GetBoolean("_bPreview3D"); if (SerializationHelper.HasElement(info, "_shapeType")) _shapeType = (TriggerShape_e)info.GetValue("_shapeType",typeof(TriggerShape_e)); // backwards compatibility if (!SerializationHelper.HasElement(info, "SupportScaling")) SetScaling_Internal(1.0f, 1.0f, 1.0f); }