Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
Passer.Humanoid.HandSocket Class Reference

Description

A Socket attached to a hand.

Inheritance diagram for Passer.Humanoid.HandSocket:
Passer.Socket

Public Types

enum  AttachMethod {
  Unknown , Parenting , ReverseParenting , Joint ,
  StaticJoint , ColliderDuplication
}
 

Public Member Functions

override bool Attach (Handle handle, bool rangeCheck=true)
 Tries to attach the given Transform to this socket.
 
override void AttachStaticJoint (Transform objTransform)
 
override void Release (bool releaseSticky=false)
 Releases a Transform from the socket.
 
override void ReleaseStaticJoint ()
 
void Attach (GameObject objectToAttach)
 
bool Attach (GameObject objectToAttach, bool rangeCheck)
 
virtual bool Attach (Transform transformToAttach, bool rangeCheck=true)
 Tries to attach the given Transform to this socket.
 
void OnDrawGizmosSelected ()
 

Static Public Member Functions

static Mesh GenerateGizmoMesh1 ()
 
static Mesh GenerateGizmoMesh ()
 

Public Attributes

HandTarget handTarget
 The handTarget of the socket.
 
GameObject attachedPrefab
 A prefab which is used to attach to the socket at startup.
 
Transform attachedTransform
 The Transform attached to this socket.
 
Handle attachedHandle
 
string socketTag
 A tag for limiting which handles can be held by the socket.
 
AttachMethod attachMethod = AttachMethod.Unknown
 
bool destroyOnLoad = false
 
GameObjectEventHandlers attachEvent
 A GameObject Event for triggering changes in the Transform held by the Socket.
 

Protected Member Functions

override void MoveSocketToHandle (Transform socketTransform, Handle handle)
 
override void MassRedistribution (Rigidbody socketRigidbody, Rigidbody objRigidbody)
 
override bool AttachRigidbody (Rigidbody objRigidbody, Handle handle, bool rangeCheck=true)
 
override void AttachRigidbodyParenting (Rigidbody objRigidbody, Handle handle)
 
override void AttachRigidbodyJoint (Rigidbody objRigidbody, Handle handle)
 
override void AttachSocketParenting (Rigidbody objRigidbody, Handle handle, Rigidbody socketRigidbody)
 
override void ReleaseRigidbodyJoint ()
 
override void ReleaseSocketParenting (Rigidbody objRigidbody, Transform socketTransform)
 
override void ReleaseStaticObject ()
 
override void MassRestoration (Rigidbody socketRigidbody, Rigidbody objRigidbody)
 
virtual void MoveHandleToSocket (Transform socketTransform, Rigidbody handleRigidbody, Handle handle)
 
virtual void MoveHandleToSocket (Transform socketTransform, Handle handle)
 
virtual void MoveRailToSocket (Transform socketTransform, Transform railTransform, Handle rail)
 
virtual void MoveSocketToHandle (Transform socketTransform, Rigidbody socketRigidbody, Handle handle)
 
void AttachTransformParenting (Transform objTransform, Handle handle)
 
virtual void AttachRigidbodyReverseJoint (Rigidbody objRigidbody, Handle handle)
 Attach handle to socket using a static joint on the handle.
 
virtual void AttachSocketParenting (Transform objTransform, Handle handle, Rigidbody thisRigidbody)
 
virtual bool AttachStaticObject (Transform objTransform, Handle handle)
 
virtual void AttachStaticJointRotY (Transform objTransform)
 
IEnumerator ClearReleasingTransform ()
 
virtual void ReleaseRigidbodyParenting ()
 
void ReleaseRigidbodyReverseJoint ()
 
void ReleaseSocketParenting (Transform objTransform)
 
void ReleaseTransformParenting ()
 
virtual void Awake ()
 
virtual void Update ()
 
void UpdateHolding ()
 
virtual void OnSceneUnload (UnityEngine.SceneManagement.Scene _)
 

Static Protected Member Functions

static void DebugLog (string s)
 

Protected Attributes

Transform releasingTransform
 
Transform attachedTransformParent
 The parent of the attached transform before it was attached.
 
RigidbodyDisabled rigidbodyDisabled = null
 
float originalMass = 1
 
bool originalUseGravity = false
 
Mesh gizmoMesh
 

Static Protected Attributes

static string[] attachEventTypeLabels
 

Properties

bool isOccupied [get]
 Does the socket currently have a handle attached?
 

Member Function Documentation

◆ MoveSocketToHandle()

override void Passer.Humanoid.HandSocket.MoveSocketToHandle ( Transform  socketTransform,
Handle  handle 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ MassRedistribution()

override void Passer.Humanoid.HandSocket.MassRedistribution ( Rigidbody  socketRigidbody,
Rigidbody  objRigidbody 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ Attach() [1/2]

override bool Passer.Humanoid.HandSocket.Attach ( Handle  handle,
bool  rangeCheck = true 
)
virtual

Tries to attach the given Transform to this socket.

If the Handle has the right Socket Tag it will be attached to the socket. Static and Kinematic Rigidbodies will be attached by parenting. Non-Kinematic Rigidbodies will be attached using a joint.

Parameters
handleThe Handle to attach to this socket
Returns
Boolean indicating whether attachment succeeded

Reimplemented from Passer.Socket.

◆ AttachRigidbody()

override bool Passer.Humanoid.HandSocket.AttachRigidbody ( Rigidbody  objRigidbody,
Handle  handle,
bool  rangeCheck = true 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ AttachRigidbodyParenting()

override void Passer.Humanoid.HandSocket.AttachRigidbodyParenting ( Rigidbody  objRigidbody,
Handle  handle 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ AttachRigidbodyJoint()

override void Passer.Humanoid.HandSocket.AttachRigidbodyJoint ( Rigidbody  objRigidbody,
Handle  handle 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ AttachSocketParenting()

override void Passer.Humanoid.HandSocket.AttachSocketParenting ( Rigidbody  objRigidbody,
Handle  handle,
Rigidbody  socketRigidbody 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ AttachStaticJoint()

override void Passer.Humanoid.HandSocket.AttachStaticJoint ( Transform  objTransform)
virtual

Reimplemented from Passer.Socket.

◆ Release()

override void Passer.Humanoid.HandSocket.Release ( bool  releaseSticky = false)
virtual

Releases a Transform from the socket.

Note that if the Transform is not taken out of the range of the socket or held by another Socket, it will automatically snap back to the Socket.

Reimplemented from Passer.Socket.

◆ ReleaseRigidbodyJoint()

override void Passer.Humanoid.HandSocket.ReleaseRigidbodyJoint ( )
protectedvirtual

Reimplemented from Passer.Socket.

◆ ReleaseSocketParenting()

override void Passer.Humanoid.HandSocket.ReleaseSocketParenting ( Rigidbody  objRigidbody,
Transform  socketTransform 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ ReleaseStaticObject()

override void Passer.Humanoid.HandSocket.ReleaseStaticObject ( )
protectedvirtual

Reimplemented from Passer.Socket.

◆ ReleaseStaticJoint()

override void Passer.Humanoid.HandSocket.ReleaseStaticJoint ( )
virtual

Reimplemented from Passer.Socket.

◆ MassRestoration()

override void Passer.Humanoid.HandSocket.MassRestoration ( Rigidbody  socketRigidbody,
Rigidbody  objRigidbody 
)
protectedvirtual

Reimplemented from Passer.Socket.

◆ Attach() [2/2]

virtual bool Passer.Socket.Attach ( Transform  transformToAttach,
bool  rangeCheck = true 
)
virtualinherited

Tries to attach the given Transform to this socket.

If the Transform has a Handle with the right Socket Tag it will be attached to the socket. Static and Kinematic Rigidbodies will be attached by parenting. Non-Kinematic Rigidbodies will be attached using a joint.

Parameters
transformToAttachThe Transform to attach to this socket
Returns
Boolean indicating whether attachment succeeded

Member Data Documentation

◆ handTarget

HandTarget Passer.Humanoid.HandSocket.handTarget

The handTarget of the socket.

This is the HandTarget of the hand to which the socket is attached

◆ attachedTransform

Transform Passer.Socket.attachedTransform
inherited

The Transform attached to this socket.

If the socket holds a Handle, this will contain the Transform of the Handle. It will be null otherwise

◆ attachedTransformParent

Transform Passer.Socket.attachedTransformParent
protectedinherited

The parent of the attached transform before it was attached.

This is used to restore the parent when the transform is released again.

◆ socketTag

string Passer.Socket.socketTag
inherited

A tag for limiting which handles can be held by the socket.

If set (not null or empty) only Handles with the given tag will fit in the socket.

◆ attachEventTypeLabels

string [] Passer.Socket.attachEventTypeLabels
staticprotectedinherited
Initial value:
= {
"Never",
"On Attach",
"On Release",
"While Attached",
"While Released",
"When Changed",
"Always"
}

◆ attachEvent

GameObjectEventHandlers Passer.Socket.attachEvent
inherited
Initial value:
= new GameObjectEventHandlers() {
label = "Hold Event",
tooltip =
"Call functions using what the socket is holding\n" +
"Parameter: the GameObject held by the socket",
eventTypeLabels = attachEventTypeLabels
}

A GameObject Event for triggering changes in the Transform held by the Socket.


The documentation for this class was generated from the following file: