Class EntityCharacter
- Namespace
- VoxelPlayground.Entity
- Assembly
- GamePlay.dll
public class EntityCharacter : Entity, ICombustible
- Inheritance
-
object
EntityCharacter
- Implements
-
- Inherited Members
-
- Extension Methods
-
Fields
aiController
public AIController aiController
Field Value
- AIController
animationController
public AnimationBase animationController
Field Value
- AnimationBase
AnimForwardParam
public static string AnimForwardParam
Field Value
- string
AnimRightParam
public static string AnimRightParam
Field Value
- string
associatedLimbs
[HideInInspector]
public List<EntityCharacter> associatedLimbs
Field Value
- List<EntityCharacter>
BodyRigidbody
[HideInInspector]
public Rigidbody BodyRigidbody
Field Value
- Rigidbody
carriedItem
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public EntityAttachmentItem carriedItem
Field Value
- EntityAttachmentItem
carriedItemJoint
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public Joint carriedItemJoint
Field Value
- Joint
carriedItemJointLeft
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public Joint carriedItemJointLeft
Field Value
- Joint
carriedItemLeft
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public EntityAttachmentItem carriedItemLeft
Field Value
- EntityAttachmentItem
characterChestHeight
public float characterChestHeight
Field Value
- float
characterController
public LocomotionHexaBody characterController
Field Value
- LocomotionHexaBody
criticalBodyParts
public List<CriticalBodyPart> criticalBodyParts
Field Value
- List<CriticalBodyPart>
DeadTime
Field Value
- float
DieOnCripple
Field Value
- bool
enemyInfo
public EnemyInfo enemyInfo
Field Value
- EnemyInfo
excludeColliderRadius
public float excludeColliderRadius
Field Value
- float
fallbackWalkingSpeed
[InfoBox("Character without EnemyInfo use this speed", InfoMessageType.Info, null)]
public float fallbackWalkingSpeed
Field Value
- float
FallingRebalanceTime
public float FallingRebalanceTime
Field Value
- float
GRIP_POINT_STR
public const string GRIP_POINT_STR = "GripPoint"
Field Value
- string
public static readonly string[] GripRelatedMusclesL
Field Value
- string[]
public static readonly string[] GripRelatedMusclesR
Field Value
- string[]
HitAnimationImpulseThreshold
public float HitAnimationImpulseThreshold
Field Value
- float
HitAnimationMoveSpeed
public float HitAnimationMoveSpeed
Field Value
- float
IsDeadAlready
public bool IsDeadAlready
Field Value
- bool
isDrawAnimationSkeleton
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public bool isDrawAnimationSkeleton
Field Value
- bool
isDrawRagdollSkeleton
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public bool isDrawRagdollSkeleton
Field Value
- bool
isFlying
Field Value
- bool
[HideInInspector]
public bool isPerformingIKAttackingAnim
Field Value
- bool
itemHolder
[HideInInspector]
public Rigidbody itemHolder
Field Value
- Rigidbody
itemHolderLeft
[HideInInspector]
public Rigidbody itemHolderLeft
Field Value
- Rigidbody
public Transform itemHolderTransform
Field Value
- Transform
public Transform itemHolderTransformLeft
Field Value
- Transform
lastHitDir_LS
[NonSerialized]
public Vector3 lastHitDir_LS
Field Value
- Vector3
lastHitPos_LS
[NonSerialized]
public Vector3 lastHitPos_LS
Field Value
- Vector3
limbConfigurableJoints
[HideInInspector]
public ConfigurableJoint[] limbConfigurableJoints
Field Value
- ConfigurableJoint[]
public Transform[] limbTransforms
Field Value
- Transform[]
[BoxGroup("Movement Settings", true, false, 0)]
public float minimalSpeedForMoveAnimation
Field Value
- float
modelGameObject
public GameObject modelGameObject
Field Value
- GameObject
muscleArmLowL
[NonSerialized]
public RagdollMuscle muscleArmLowL
Field Value
- RagdollMuscle
muscleArmLowR
[NonSerialized]
public RagdollMuscle muscleArmLowR
Field Value
- RagdollMuscle
muscleArmUpL
[NonSerialized]
public RagdollMuscle muscleArmUpL
Field Value
- RagdollMuscle
muscleArmUpR
[NonSerialized]
public RagdollMuscle muscleArmUpR
Field Value
- RagdollMuscle
[NonSerialized]
public RagdollMuscle muscleFootL
Field Value
- RagdollMuscle
[NonSerialized]
public RagdollMuscle muscleFootR
Field Value
- RagdollMuscle
muscleHandL
[NonSerialized]
public RagdollMuscle muscleHandL
Field Value
- RagdollMuscle
muscleHandR
[NonSerialized]
public RagdollMuscle muscleHandR
Field Value
- RagdollMuscle
muscleHead
[NonSerialized]
public RagdollMuscle muscleHead
Field Value
- RagdollMuscle
muscleHip
[NonSerialized]
public RagdollMuscle muscleHip
Field Value
- RagdollMuscle
muscleLegLowL
[NonSerialized]
public RagdollMuscle muscleLegLowL
Field Value
- RagdollMuscle
muscleLegLowR
[NonSerialized]
public RagdollMuscle muscleLegLowR
Field Value
- RagdollMuscle
muscleLegUpL
[NonSerialized]
public RagdollMuscle muscleLegUpL
Field Value
- RagdollMuscle
muscleLegUpR
[NonSerialized]
public RagdollMuscle muscleLegUpR
Field Value
- RagdollMuscle
musclesArmR
[ShowInInspector]
[NonSerialized]
public RagdollMuscle[] musclesArmR
Field Value
- RagdollMuscle[]
muscleSpine
[NonSerialized]
public RagdollMuscle muscleSpine
Field Value
- RagdollMuscle
onDie
Field Value
- Action
originalCharacter
[HideInInspector]
public EntityCharacter originalCharacter
Field Value
- EntityCharacter
pelvisHeightGhostProgress
[HideInInspector]
public float pelvisHeightGhostProgress
Field Value
- float
ragdollStability
[Range(0, 1)]
public float ragdollStability
Field Value
- float
public Transform RightShoulderTransform
Field Value
- Transform
runAnimScaleIfEnabled
[BoxGroup("Movement Settings", true, false, 0, ShowLabel = true)]
public float runAnimScaleIfEnabled
Field Value
- float
SittingOn
[NonSerialized]
public Seat SittingOn
Field Value
- Seat
skipPartiallyCrippled
public bool skipPartiallyCrippled
Field Value
- bool
stateMachine
[HideInInspector]
public CharacterStateMachine stateMachine
Field Value
- CharacterStateMachine
stuckTimer
[NonSerialized]
[ShowInInspector]
public float stuckTimer
Field Value
- float
timeAwake
[NonSerialized]
public float timeAwake
Field Value
- float
TmpDisableFallingUntil
public float TmpDisableFallingUntil
Field Value
- float
useLegsAnimator
public bool useLegsAnimator
Field Value
- bool
useLOD
Field Value
- bool
useRunAnimation
[BoxGroup("Movement Settings", true, false, 0, ShowLabel = true)]
public bool useRunAnimation
Field Value
- bool
voxelRagdollDismember
public VoxelRagdollDismember voxelRagdollDismember
Field Value
- VoxelRagdollDismember
vrControllerOffset
public float vrControllerOffset
Field Value
- float
walkingAnimSpeedScale
[BoxGroup("Movement Settings", true, false, 0)]
public float walkingAnimSpeedScale
Field Value
- float
Properties
BodyTransform
public Transform BodyTransform { get; }
Property Value
- Transform
BottomPosition
public Vector3 BottomPosition { get; }
Property Value
- Vector3
public Transform bottomTransform { get; }
Property Value
- Transform
CurLODLevel
public int CurLODLevel { get; }
Property Value
- int
deathCause
public DeathCause deathCause { get; }
Property Value
- DeathCause
groundRootAttachmentItems
public List<EntityAttachmentItem> groundRootAttachmentItems { get; }
Property Value
- List<EntityAttachmentItem>
HeadPosition
public Vector3 HeadPosition { get; }
Property Value
- Vector3
HipPosition
public Vector3 HipPosition { get; }
Property Value
- Vector3
IsBeingStabbed
public bool IsBeingStabbed { get; }
Property Value
- bool
IsCarriedSomething
public bool IsCarriedSomething { get; }
Property Value
- bool
isClimbing
[ShowInInspector]
[SuffixLabel("Debug", false)]
public bool isClimbing { get; }
Property Value
- bool
IsControllingHandsIK
public bool IsControllingHandsIK { get; }
Property Value
- bool
IsCrippled
public bool IsCrippled { get; }
Property Value
- bool
isFragment
[ShowInInspector]
public bool isFragment { get; }
Property Value
- bool
IsGrabbedByAnyHand
public bool IsGrabbedByAnyHand { get; }
Property Value
- bool
IsGrounded
public bool IsGrounded { get; }
Property Value
- bool
IsHoldingWeapon
public bool IsHoldingWeapon { get; }
Property Value
- bool
IsHoldingWeaponMelee
public bool IsHoldingWeaponMelee { get; }
Property Value
- bool
IsHoldingWeaponRanged
public bool IsHoldingWeaponRanged { get; }
Property Value
- bool
IsWeaponAttacking
public bool IsWeaponAttacking { get; }
Property Value
- bool
LifeTimeFrame
public int LifeTimeFrame { get; }
Property Value
- int
Position
public Vector3 Position { get; }
Property Value
- Vector3
RotateSpeed
public float RotateSpeed { get; }
Property Value
- float
WalkingSpeed
public float WalkingSpeed { get; }
Property Value
- float
walkSpeedMultiplier
[BoxGroup("Movement Settings", true, false, 0)]
public float walkSpeedMultiplier { get; }
Property Value
- float
Methods
AddVelocity(Vector3, ForceMode)
public void AddVelocity(Vector3 vel, ForceMode forceMode = ForceMode.VelocityChange)
Parameters
vel Vector3
forceMode ForceMode
AdjustArm(HandSide)
public void AdjustArm(HandSide handSide)
Parameters
handSide HandSide
ApplyMuscleProfileDead()
public void ApplyMuscleProfileDead()
ApplyMuscleProfileStrong()
public void ApplyMuscleProfileStrong()
ApplyMuscleProfileWeak()
public void ApplyMuscleProfileWeak()
Atk()
[Button]
public void Atk()
Awake()
protected override void Awake()
[Button]
public void BeginControlHandsIK(Transform rhandTarget, Transform lhandTarget = null)
Parameters
rhandTarget Transform
lhandTarget Transform
BeginHandGrabBody(Collider, bool)
public void BeginHandGrabBody(Collider collider, bool isLeftHand = false)
Parameters
collider Collider
isLeftHand bool
Burn()
CarriedItemIndirect(bool)
public EntityAttachmentItem CarriedItemIndirect(bool isLeft)
Parameters
isLeft bool
Returns
- EntityAttachmentItem
CarriedRigidbody(bool)
public Rigidbody CarriedRigidbody(bool isLeft)
Parameters
isLeft bool
Returns
- Rigidbody
CarriedRigidbodyAnchorRelHand(bool, bool)
public Vector3 CarriedRigidbodyAnchorRelHand(bool isLeft, bool excludeWeapon = true)
Parameters
isLeft bool
excludeWeapon bool
Returns
- Vector3
ChangeState(State)
[Button]
public void ChangeState(EntityCharacter.State state)
Parameters
state EntityCharacter.State
CheckCrippled()
public void CheckCrippled()
CheckGroundHitObjectConnectivity()
[Button]
public void CheckGroundHitObjectConnectivity()
CheckIsClimbing()
[Button]
public void CheckIsClimbing()
CleanupAssociations()
public void CleanupAssociations()
Die(DeathCause)
[Button]
public void Die(DeathCause cause = DeathCause.Unknown)
Parameters
cause DeathCause
DieIfCriticalPartFractured()
[Button]
public void DieIfCriticalPartFractured()
ElectricShock()
[Button]
public void ElectricShock()
EndControlHandsIK()
[Button]
public void EndControlHandsIK()
EndHandGrabBody(bool)
public void EndHandGrabBody(bool isLeftHand = false)
Parameters
isLeftHand bool
Equip_LeftHand(EntityAttachmentItem)
[Button]
public void Equip_LeftHand(EntityAttachmentItem entityItem)
Parameters
entityItem EntityAttachmentItem
Equip(EntityAttachmentItem)
[Button]
public void Equip(EntityAttachmentItem entityItem)
Parameters
entityItem EntityAttachmentItem
EquipArmors(EquipmentsData)
public void EquipArmors(EquipmentsData equipmentsData)
Parameters
equipmentsData EquipmentsData
Extinguish()
FirstPerson()
[Button]
public void FirstPerson()
FirstPersonPC()
[Button]
public void FirstPersonPC()
ForceKnockout()
public void ForceKnockout()
FreezeArms(HandSide, float)
public void FreezeArms(HandSide handSide, float delay = 3)
Parameters
handSide HandSide
delay float
GetCarriedItem(bool)
public EntityAttachmentItem GetCarriedItem(bool isLeftHand)
Parameters
isLeftHand bool
Returns
- EntityAttachmentItem
GetCarryItemPoint()
public Transform GetCarryItemPoint()
Returns
- Transform
GetCarryItemPoint_LeftHand()
public Transform GetCarryItemPoint_LeftHand()
Returns
- Transform
GetCrippleState()
public CrippleState GetCrippleState()
Returns
- CrippleState
GetPinchCenterPoint(Rigidbody)
public override Vector3 GetPinchCenterPoint(Rigidbody hitRb)
Parameters
hitRb Rigidbody
Returns
- Vector3
GetPosition()
public Vector3 GetPosition()
Returns
- Vector3
public void Grabbed(Transform rbTransBeingGrabbed)
Parameters
rbTransBeingGrabbed Transform
HitStun(Vector3)
public void HitStun(Vector3 hitForceDir)
Parameters
hitForceDir Vector3
HitStunFlinch(Vector3)
public void HitStunFlinch(Vector3 hitPos)
Parameters
hitPos Vector3
Idle()
[Button]
public void Idle()
IgnoreEntityCollisionEx(Entity, bool)
public void IgnoreEntityCollisionEx(Entity entity, bool isIgnore)
Parameters
entity Entity
isIgnore bool
IgnoreEntityItemCollision(EntityItem, bool)
public void IgnoreEntityItemCollision(EntityItem entityItem, bool _b)
Parameters
entityItem EntityItem
_b bool
IgnoreFeetCollisionsWithEnv(FeetEnvIgnoreMode)
public void IgnoreFeetCollisionsWithEnv(EntityCharacter.FeetEnvIgnoreMode mode)
Parameters
mode EntityCharacter.FeetEnvIgnoreMode
IsACompleteHumanoid()
public bool IsACompleteHumanoid()
Returns
- bool
IsBurning()
Returns
- bool
IsCarriedItem(EntityAttachmentItem)
public bool IsCarriedItem(EntityAttachmentItem item)
Parameters
item EntityAttachmentItem
Returns
- bool
IsCarriedRigidbody(bool)
public bool IsCarriedRigidbody(bool leftHand)
Parameters
leftHand bool
Returns
- bool
IsDead()
Returns
- bool
IsHandCarried(bool)
public bool IsHandCarried(bool leftHand)
Parameters
leftHand bool
Returns
- bool
IsHandGrabbedBody(bool)
public bool IsHandGrabbedBody(bool isLeftHand = false)
Parameters
isLeftHand bool
Returns
- bool
IsKnockedOut()
public bool IsKnockedOut()
Returns
- bool
IsMoving()
Returns
- bool
public bool IsMuscleBeingGrabbed(Transform muscleTrans)
Parameters
muscleTrans Transform
Returns
- bool
IsMuscleProfileKnockedOut()
public bool IsMuscleProfileKnockedOut()
Returns
- bool
IsPlayer()
Returns
- bool
IsRbCarriedItem(Rigidbody)
public bool IsRbCarriedItem(Rigidbody rb)
Parameters
rb Rigidbody
Returns
- bool
IsRigidbodyPartOfArm(Rigidbody, out HandSide, bool)
public bool IsRigidbodyPartOfArm(Rigidbody rb, out HandSide handSide, bool checkKnockoutState = true)
Parameters
rb Rigidbody
handSide HandSide
checkKnockoutState bool
Returns
- bool
Jump(float, bool)
[Button]
public void Jump(float force = 20, bool forceJump = false)
Parameters
force float
forceJump bool
KnockOff(Vector3)
public void KnockOff(Vector3 force)
Parameters
force Vector3
KnockOut()
[Button]
public void KnockOut()
LayDown()
[Button]
public void LayDown()
MoveControllerInTheAir(Vector3, float)
public void MoveControllerInTheAir(Vector3 dir, float speed)
Parameters
dir Vector3
speed float
MoveTowards(Vector3, float)
[Obsolete("Use WalkTowards instead")]
public void MoveTowards(Vector3 targetPos, float speed = 1)
Parameters
targetPos Vector3
speed float
OnBeStabbed(Entity, bool)
public override void OnBeStabbed(Entity stabber, bool isStabbed)
Parameters
stabber Entity
isStabbed bool
OnDestroy()
public override void OnDestroy()
public void OnFragmentCreated(VoxelVolume dataOwner, Transform root, int count)
Parameters
dataOwner VoxelVolume
root Transform
count int
OnGetHit(VoxelCollisionInfo)
public void OnGetHit(VoxelCollisionInfo voxelCollisionInfo)
Parameters
voxelCollisionInfo VoxelCollisionInfo
OnRagdollStateChange(StandState)
public void OnRagdollStateChange(MotionDetector.StandState standState)
Parameters
standState MotionDetector.StandState
PlayAnimationCrossFade(string, float, float, float, bool)
[Button]
public void PlayAnimationCrossFade(string name = "Hit_R_H", float transitionDuration = 0.2, float ghostProgressBeg = 0.2, float ghostProgressEnd = 0.5, bool animControl = true)
Parameters
name string
transitionDuration float
ghostProgressBeg float
ghostProgressEnd float
animControl bool
PlayerControlling()
[Button]
public void PlayerControlling()
PlayHitAnim(Vector3, Vector3)
public void PlayHitAnim(Vector3 point, Vector3 hitToDir)
Parameters
point Vector3
hitToDir Vector3
PlayIdleAnimation(bool)
public void PlayIdleAnimation(bool isUpLayerEnable = true)
Parameters
isUpLayerEnable bool
PostInit(VoxelVolume)
public void PostInit(VoxelVolume volume)
Parameters
volume VoxelVolume
PutDownItem(bool, bool)
[Button]
public void PutDownItem(bool throwForce = true, bool onlyLeft = false)
Parameters
throwForce bool
onlyLeft bool
RangedWeaponAimPitchTo(Vector3)
public void RangedWeaponAimPitchTo(Vector3 targetPos)
Parameters
targetPos Vector3
RecreateArmJointLimits()
public void RecreateArmJointLimits()
ReleaseArmJointLimits()
public void ReleaseArmJointLimits()
public void Released(Transform releasedMuscleTrans, EntityCharacter grabbedByEntityCharacter)
Parameters
releasedMuscleTrans Transform
grabbedByEntityCharacter EntityCharacter
ResetAnimation()
public void ResetAnimation()
ResetRagdollStability()
public void ResetRagdollStability()
ResetRestraintSpeedMultiplier()
public void ResetRestraintSpeedMultiplier()
RotateTowards(Vector3, float, bool, bool)
public void RotateTowards(Vector3 targetPos, float speed = 3, bool move = false, bool rot = true)
Parameters
targetPos Vector3
speed float
move bool
rot bool
ScaleWalkingSpeed(float)
public void ScaleWalkingSpeed(float scale)
Parameters
scale float
SetAttack(bool)
public void SetAttack(bool active)
Parameters
active bool
SetFlying(bool)
public void SetFlying(bool fly)
Parameters
fly bool
SetForeArmGripType(GripType, CarryHand)
public void SetForeArmGripType(EntityCharacter.GripType gripType, CarryHand carryHand)
Parameters
gripType EntityCharacter.GripType
carryHand CarryHand
SetLimbIK(MonoBehaviour[])
public void SetLimbIK(MonoBehaviour[] iks)
Parameters
iks MonoBehaviour[]
SetMuscleStrength_RightArm(float, bool)
[Button]
public void SetMuscleStrength_RightArm(float strength = -1, bool includeLeftArm = false)
Parameters
strength float
includeLeftArm bool
SetPosition(Vector3)
public void SetPosition(Vector3 position)
Parameters
position Vector3
SetRagdollRebalanceEnable(bool)
public void SetRagdollRebalanceEnable(bool enable)
Parameters
enable bool
SetRagdollStabilityPercentage(float)
public void SetRagdollStabilityPercentage(float percentage)
Parameters
percentage float
SetRestraintSpeedMultiplier(float, float)
public void SetRestraintSpeedMultiplier(float speedMultiplier, float rotationMultiplier)
Parameters
speedMultiplier float
rotationMultiplier float
SetupFistCollisionHandler()
public void SetupFistCollisionHandler()
Sit()
[Button]
public void Sit()
SlowDown(float)
public void SlowDown(float factor = 0.95)
Parameters
factor float
SpawnAt(CharacterData, Vector3)
public static UniTask<EntityCharacter> SpawnAt(CharacterData chData, Vector3 spawnPoint)
Parameters
chData CharacterData
spawnPoint Vector3
Returns
- UniTask<EntityCharacter>
SpawnAt(EquipmentsData, Vector3, GameObject)
public static UniTask<EntityCharacter> SpawnAt(EquipmentsData equipData, Vector3 spawnPoint, GameObject defaultSpawnCharacter = null)
Parameters
equipData EquipmentsData
spawnPoint Vector3
defaultSpawnCharacter GameObject
Returns
- UniTask<EntityCharacter>
Start()
protected override void Start()
StartManipulatingArm(HandSide)
[Button]
public void StartManipulatingArm(HandSide handSide)
Parameters
handSide HandSide
StopAttack()
[Button]
public void StopAttack()
StopManipulatingArm(HandSide)
public void StopManipulatingArm(HandSide handSide)
Parameters
handSide HandSide
[Button]
public void Teleport(Transform pos)
Parameters
pos Transform
Teleport(Vector3, Quaternion)
[Button]
public override void Teleport(Vector3 pos, Quaternion rot)
Parameters
pos Vector3
rot Quaternion
ToggleHandGrabBody(bool)
public void ToggleHandGrabBody(bool isLeftHand = false)
Parameters
isLeftHand bool
public Vector3 TransformPoint_Ragdoll2Anim(Vector3 worldpos)
Parameters
worldpos Vector3
Returns
- Vector3
TryHandGrabBody(bool)
public void TryHandGrabBody(bool isLeftHand = false)
Parameters
isLeftHand bool
TryHandUnGrabBody(bool)
public bool TryHandUnGrabBody(bool isLeftHand = false)
Parameters
isLeftHand bool
Returns
- bool
UpdateLODLevel()
public void UpdateLODLevel()
UpdateReload(float)
public void UpdateReload(float deltaTime)
Parameters
deltaTime float
UpdateVoxelCollidersRef()
public void UpdateVoxelCollidersRef()
Walk()
[Button]
public void Walk()
WalkTo(Vector3, float, float, bool, bool, float)
public void WalkTo(Vector3 targetPos, float speed = 3, float rotateSpeed = 1, bool rot = true, bool move = true, float deltaTime = -1)
Parameters
targetPos Vector3
speed float
rotateSpeed float
rot bool
move bool
deltaTime float
WalkTowards(Vector3, float, float, bool, bool, float, bool)
public void WalkTowards(Vector3 targetDir, float speed = 3, float rotateSpeed = 1, bool rot = true, bool move = true, float deltaTime = -1, bool rotInstant = false)
Parameters
targetDir Vector3
speed float
rotateSpeed float
rot bool
move bool
deltaTime float
rotInstant bool