void OnDestroy() { //Debug.Log("Destroying body"); //gcHandle_instance.Free(); NewtonWorld world = NewtonWorld.Instance; // No need to destroy the body if the application is shutting down, Newton will have destroyed all remaining bodies. if (world != null) { //Debug.Log("Destroyed body(" + pBody.ToString() + ")"); NewtonAPI.NewtonDestroyBody(pBody); } //else // Debug.Log("World already destroyed"); }