コード例 #1
0
        void UpdateFromParamsAndApply(Attachment attachment)
        {
            if (!IsConnected(attachment))
            {
                return;
            }
            AttachObject jointed   = GetJointedObject(attachment);
            AttachObject connected = GetConnectedObject(attachment);

            // fixme - need to only update anchors if they have actually changed (same as 2D)?
            PhysicsAttachStrategyHelper.CreateOrApplyAllJoints(jointed, connected, jointDescriptions,
                                                               null, hideJointsInInspector);
        }
コード例 #2
0
        void UpdateFromParamsAndApply(Attachment attachment)
        {
            AttachObject root = GetRoot(attachment);

            if (root == null || !root.isConnected)
            {
                return;
            }
            AttachObjectList.Enumerator e = attachment.objects.GetEnumerator(phase: AttachObjectPhase.Connected,
                                                                             category: (int)Categories.Leaves);
            while (e.MoveNext())
            {
                AttachObject leaf = e.Current;
                PhysicsAttachStrategyHelper.CreateOrApplyAllJoints(leaf, root, jointDescriptions, leaf,
                                                                   hideJointsInInspector);
            }
        }
コード例 #3
0
 void UpdateFromParamsAndApply(Attachment attachment)
 {
     // fixme - updating the anchors will also change a hinge joint's reference angle, which means the limits
     // will change if they are based on the starting rotation. :/  need to only update anchors if they have
     // actually changed.
     AttachObjectList.Enumerator e = attachment.objects.GetEnumerator(phase: AttachObjectPhase.Connected);
     while (e.MoveNext())
     {
         AttachObject link     = e.Current;
         AttachObject nextLink = GetNextLink(link);
         if (nextLink == null || !nextLink.isConnected)
         {
             continue;
         }
         // put the joint on nextLink - so it is also the reference object
         PhysicsAttachStrategyHelper.CreateOrApplyAllJoints(nextLink, link, jointDescriptions,
                                                            nextLink, hideJointsInInspector);
     }
 }
コード例 #4
0
 protected override void DisconnectBoth(AttachObject jointed, AttachObject connected)
 {
     PhysicsAttachStrategyHelper.DestroyJoints(jointed);
 }
コード例 #5
0
 protected override void ConnectBoth(AttachObject jointed, AttachObject connected)
 {
     PhysicsAttachStrategyHelper.CreateOrApplyAllJoints(jointed, connected, jointDescriptions,
                                                        null, hideJointsInInspector);
 }
コード例 #6
0
 protected override void DisconnectLeaf(AttachObject root, AttachObject leaf)
 {
     PhysicsAttachStrategyHelper.DestroyJoints(leaf);
 }
コード例 #7
0
 protected override void ConnectLeaf(AttachObject root, AttachObject leaf)
 {
     PhysicsAttachStrategyHelper.CreateOrApplyAllJoints(leaf, root, jointDescriptions, leaf,
                                                        hideJointsInInspector);
 }
コード例 #8
0
 protected override void DisconnectLinks(AttachObject link, AttachObject nextLink)
 {
     PhysicsAttachStrategyHelper.DestroyJoints(nextLink);
 }
コード例 #9
0
 protected override void ConnectLinks(AttachObject link, AttachObject nextLink)
 {
     // put the joint on nextLink - so it is also the reference object
     PhysicsAttachStrategyHelper.CreateOrApplyAllJoints(nextLink, link, jointDescriptions,
                                                        nextLink, hideJointsInInspector);
 }