コード例 #1
0
    public void _Remove(ChipmunkBody obj)
    {
        if (obj._handle == IntPtr.Zero)
        {
            Debug.LogError("ChipmunkBody handle is NULL");
            return;
        }

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

        PostStepFunc del = delegate(){
            //		Debug.Log("Removing body.");
            bodies.Remove(obj);
            CP.cpSpaceRemoveBody(_handle, obj._handle);
        };

        if (locked)
        {
            _AddPostStepCallback(_handle, obj.handle, del);
        }
        else
        {
            del();
        }
    }
コード例 #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();
        }
    }
コード例 #3
0
    public void _Add(ChipmunkBody obj)
    {
        PostStepFunc del = delegate(){
            //		Debug.Log("Adding body.");

            bodies.Add(obj);
            CP.cpSpaceAddBody(_handle, obj.handle);
        };

        if (locked)
        {
            _AddPostStepCallback(_handle, obj.handle, del);
        }
        else
        {
            del();
        }
    }
コード例 #4
0
 [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void _AddPostStepCallback(IntPtr handle, IntPtr key, PostStepFunc callback);
コード例 #5
0
 extern static void cpSpaceAddPostStepCallback(IntPtr space, PostStepFunc func, IntPtr key, IntPtr data);