Beispiel #1
0
    public void _Remove(ChipmunkConstraint obj)
    {
        if (obj._handle == IntPtr.Zero)
        {
            Debug.LogError("ChipmunkConstraint handle is NULL");
            return;
        }

        if (!CP.cpSpaceContainsConstraint(_handle, obj._handle))
        {
            Debug.LogError("Space does not contain ChipmunkConstraint.");
            return;
        }

        PostStepFunc del = delegate(){
            //		Debug.Log("Removing shape.");
            CP.cpSpaceRemoveConstraint(_handle, obj._handle);
        };

        if (locked)
        {
            _AddPostStepCallback(_handle, obj.handle, del);
        }
        else
        {
            del();
        }
    }
Beispiel #2
0
    public void _Add(ChipmunkConstraint obj)
    {
        PostStepFunc del = delegate(){
            //		Debug.Log("Adding shape.");
            CP.cpSpaceAddConstraint(_handle, obj.handle);
        };

        if (locked)
        {
            _AddPostStepCallback(_handle, obj.handle, del);
        }
        else
        {
            del();
        }
    }