示例#1
0
        protected void RemoveCollider()
        {
            // Unregister collider:
            Component unityCollider = GetUnityCollider(ref wasUnityColliderEnabled);

            if (unityCollider != null)
            {
                idToCollider.Remove(unityCollider.GetInstanceID());
            }

            // Unsubscribe collider callback:
            ObiSolver.OnUpdateColliders      -= UpdateIfNeeded;
            ObiSolver.OnAfterUpdateColliders -= ResetTransformChanges;

            // Remove and destroy collider:
            Oni.RemoveCollider(oniCollider);
            Oni.DestroyCollider(oniCollider);
            oniCollider = IntPtr.Zero;

            // Destroy shape tracker:
            if (tracker != null)
            {
                tracker.Destroy();
                tracker = null;
            }
        }
        protected void RemoveCollider()
        {
            ObiColliderWorld.GetInstance().DestroyCollider(shapeHandle);

            // Destroy shape tracker:
            if (tracker != null)
            {
                tracker.Destroy();
                tracker = null;
            }
        }
示例#3
0
        private void OnDestroy()
        {
            // Unregister collider:
            if (unityCollider != null)
            {
                idToCollider.Remove(unityCollider.GetInstanceID());
            }

            // Unsubscribe collider callback:
            ObiSolver.OnUpdateColliders -= UpdateIfNeeded;

            // Destroy collider:
            Oni.DestroyCollider(oniCollider);
            oniCollider = IntPtr.Zero;

            // Destroy shape tracker:
            if (tracker != null)
            {
                tracker.Destroy();
                tracker = null;
            }
        }
        private void OnDestroy()
        {
            // Unregister collider:
            if (unityCollider != null)
            {
                idToCollider.Remove(unityCollider.GetInstanceID());
            }

            // Unsubscribe collider and rigidbody update callbacks:
            ObiArbiter.OnStepStart -= UpdateIfNeeded;
            ObiArbiter.OnStepEnd   -= UpdateRigidbody;

            // Destroy collider:
            Oni.DestroyCollider(oniCollider);
            oniCollider = IntPtr.Zero;

            // Destroy shape tracker:
            if (tracker != null)
            {
                tracker.Destroy();
                tracker = null;
            }
        }