public static void Update(ref BulletPhysicsComponent bpc) { foreach (var entry in _flippers) { PhyFlipper phyFlipper = entry.Value; phyFlipper._FlipperUpdate(ref bpc); // debug var dbg = EngineProvider <IDebugUI> .Get(); bool isChanged = false; float sa = phyFlipper._startAngle * 180.0f / Mathf.PI; float se = phyFlipper._endAngle * 180.0f / Mathf.PI; isChanged |= dbg.GetProperty(phyFlipper.dbgPropStartAngle, ref sa); isChanged |= dbg.GetProperty(phyFlipper.dbgPropEndAngle, ref se); if (isChanged) { phyFlipper._startAngle = sa * Mathf.PI / 180.0f; phyFlipper._endAngle = se * Mathf.PI / 180.0f; HingeConstraint hinge = (HingeConstraint)phyFlipper._constraint; if (phyFlipper.RotationDirection == 1) { hinge.SetLimit(phyFlipper._startAngle, phyFlipper._endAngle, 0.0f); } else { hinge.SetLimit(phyFlipper._endAngle, phyFlipper._startAngle, 0.0f); } } } }
private void _UpdateGameObjects() { var bpc = (BulletPhysicsComponent)this; PhyFlipper.Update(ref bpc); }