Fix attachedHandle when attaching from the Editor
This commit is contained in:
parent
5c6b226b64
commit
a0d2a00a3a
@ -76,6 +76,8 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
protected virtual void AttachPrefab(Socket socket, SerializedProperty attachedTransformProp, GameObject prefab) {
|
||||
SerializedProperty attachedHandleProp = serializedObject.FindProperty("attachedHandle");
|
||||
|
||||
if (attachedTransformProp.objectReferenceValue != null)
|
||||
ReleaseObject(socket, attachedTransformProp);
|
||||
|
||||
@ -87,6 +89,7 @@ namespace Passer.Humanoid {
|
||||
Debug.LogWarning("Could not attach transform");
|
||||
else {
|
||||
attachedTransformProp.objectReferenceValue = obj;
|
||||
attachedHandleProp.objectReferenceValue = socket.attachedHandle;
|
||||
//Handle handle = socket.attachedHandle;
|
||||
//if (handle == null)
|
||||
// Handle.Create(obj, socket);
|
||||
|
@ -580,10 +580,10 @@ namespace Passer.Humanoid {
|
||||
AdvancedHandPhysics.SetNonKinematic(handRigidbody, colliders);
|
||||
}
|
||||
|
||||
//if (handle.socket != null) {
|
||||
// Debug.Log("Grab from socket");
|
||||
// handle.socket.Release();
|
||||
//}
|
||||
if (handle.socket != null) {
|
||||
Debug.Log("Grab from socket");
|
||||
handle.socket.Release();
|
||||
}
|
||||
|
||||
targetToHandle = hand.target.transform.InverseTransformPoint(grabSocket.transform.position);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user