protected override void Uninitialize(BepuPhysicsSystem system) { this.Transform.PositionChanged -= OnTransformPositionManuallyChanged; this.Transform.RotationChanged -= OnTransformRotationManuallyChanged; if (this.physicsEntity != null) { system.RemoveObject(this.physicsEntity); } }
protected override void Initialize(BepuPhysicsSystem system) { this.Transform.PositionChanged += OnTransformPositionManuallyChanged; this.Transform.RotationChanged += OnTransformRotationManuallyChanged; this.Transform.ScaleChanged += OnTransformScaleManuallyChanged; this.system = system; this.PhysicsEntity = InitPhysicsEntity(); OnTransformPositionManuallyChanged(this.Transform.Position); OnTransformRotationManuallyChanged(this.Transform.Rotation); }
protected override void Initialize(BepuPhysicsSystem system) { base.Initialize(system); this.Transform.ScaleChanged += OnScaleChanged; }