Beispiel #1
0
    protected override void Awake()
    {
        if (_handle != IntPtr.Zero)
        {
            return;
        }

        _handle = CP.cpDampedSpringNew(IntPtr.Zero, IntPtr.Zero, Vector2.zero, Vector2.zero, 10f, 10f, 10f);
//		_handle = CP.cpDampedSpringNew(IntPtr.Zero, IntPtr.Zero, new Vector2(10f, 10f), new Vector2(10f, 10f), 0f, 1f, 0f);

        var gch = GCHandle.Alloc(this);

        CP._cpConstraintSetUserData(_handle, GCHandle.ToIntPtr(gch));
    }