コード例 #1
0
ファイル: ChipmunkPinJoint.cs プロジェクト: iboy/shadowengine
    protected override void Awake()
    {
        if(_handle != IntPtr.Zero) return;

        _handle = CP.cpPinJointNew(IntPtr.Zero, IntPtr.Zero, Vector2.zero, Vector2.zero);

        var gch = GCHandle.Alloc(this);
        CP._cpConstraintSetUserData(_handle, GCHandle.ToIntPtr(gch));
    }
コード例 #2
0
    protected override void Awake()
    {
        if (_handle != IntPtr.Zero)
        {
            return;
        }

        _handle = CP.cpDampedRotarySpringNew(IntPtr.Zero, IntPtr.Zero, 0f, 0f, 0f);

        var gch = GCHandle.Alloc(this);

        CP._cpConstraintSetUserData(_handle, GCHandle.ToIntPtr(gch));
    }
コード例 #3
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));
    }