private void IScene_PropertyChanged(object sender, PropertyChangedArgs e) { // Check whether a constraint property has been changed, so that we can update the native // properties (useful when running the game in editor). Situations to cover: // - User directly modified a property of the typeProperty instance: can be explicitly checked // - User modified the value of a sub-property: difficult to check. In that case we assume that // - The user moved/rotated/scaled a parent of the constraint shape // any component belonging to the HavokEditorPlugin/HavokManaged assemblies is relevant for us. if (e._component == _typeProperties || e._component.GetType().Assembly == this.GetType().Assembly || e._component.GetType().Assembly == typeof(HavokManaged.ConstraintStateBase).Assembly || (IsChildOrSubChildOf(e._component as ShapeBase) && (e._propertyName == "Position" || e._propertyName == "Orientation" || e._propertyName == "Scaling"))) { if (_engineInstance != null && ParentLayer.Modifiable) { // Set the constraint properties on the engine instance, since the user modified them EngineConstraintInstance.SetConstraintProperties(_typeProperties); this.ParentLayer.Modified = true; } } }