Fix grabbing from socket
This commit is contained in:
parent
200db545b9
commit
222d183086
@ -165,7 +165,8 @@ namespace Passer {
|
|||||||
ReverseParenting,
|
ReverseParenting,
|
||||||
Joint,
|
Joint,
|
||||||
StaticJoint,
|
StaticJoint,
|
||||||
ColliderDuplication
|
ColliderDuplication,
|
||||||
|
ReverseJoint,
|
||||||
}
|
}
|
||||||
public AttachMethod attachMethod = AttachMethod.Unknown;
|
public AttachMethod attachMethod = AttachMethod.Unknown;
|
||||||
|
|
||||||
@ -277,6 +278,9 @@ namespace Passer {
|
|||||||
Attach(objectToAttach, false);
|
Attach(objectToAttach, false);
|
||||||
}
|
}
|
||||||
public bool Attach(GameObject objectToAttach, bool rangeCheck) {
|
public bool Attach(GameObject objectToAttach, bool rangeCheck) {
|
||||||
|
if (objectToAttach == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
bool success = Attach(objectToAttach.transform, rangeCheck);
|
bool success = Attach(objectToAttach.transform, rangeCheck);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
@ -515,6 +519,7 @@ namespace Passer {
|
|||||||
attachedTransform = objRigidbody.transform;
|
attachedTransform = objRigidbody.transform;
|
||||||
attachedHandle = handle;
|
attachedHandle = handle;
|
||||||
handle.socket = this;
|
handle.socket = this;
|
||||||
|
attachMethod = AttachMethod.ReverseJoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void AttachSocketParenting(Rigidbody objRigidbody, Handle handle, Rigidbody socketRigidbody) {
|
protected virtual void AttachSocketParenting(Rigidbody objRigidbody, Handle handle, Rigidbody socketRigidbody) {
|
||||||
@ -648,6 +653,9 @@ namespace Passer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case AttachMethod.ReverseJoint:
|
||||||
|
ReleaseRigidbodyReverseJoint();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
||||||
if (this.rigidbodyDisabled != null)
|
if (this.rigidbodyDisabled != null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user