Class EntityAttachmentItem
- Namespace
- VoxelPlayground.Entity
- Assembly
- GamePlay.dll
public class EntityAttachmentItem : EntityItem
- Inheritance
-
objectEntityAttachmentItem
- Derived
- Inherited Members
- Extension Methods
Fields
attachDistance
[TabGroup("Attachment", false, 0)]
public float attachDistance
Field Value
- float
attachObj
[TabGroup("Attachment", false, 0)]
public AttachObj attachObj
Field Value
attachOnStart
[TabGroup("Attachment", false, 0)]
public GameObject attachOnStart
Field Value
carriedTooltip
[Multiline]
public string carriedTooltip
Field Value
- string
connectedCharacter
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public EntityCharacter connectedCharacter
Field Value
directAttachList
protected HashSet<EntityAttachmentItem> directAttachList
Field Value
- HashSet<EntityAttachmentItem>
durability
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public float durability
Field Value
- float
durabilityDamageRelVelThreshold
public float durabilityDamageRelVelThreshold
Field Value
- float
extraVoxelDatas
public List<VoxelVolume> extraVoxelDatas
Field Value
- List<VoxelVolume>
freeAttachLayer
[TabGroup("Attachment", false, 0)]
public LayerMask freeAttachLayer
Field Value
gripPose
public GripPose gripPose
Field Value
group
public AttachmentItemGroup group
Field Value
hasAttachedOnstart
[HideInInspector]
public bool hasAttachedOnstart
Field Value
- bool
hasDestroy
protected bool hasDestroy
Field Value
- bool
invincibleTime
public float invincibleTime
Field Value
- float
isDangerousWithWideAvoidance
public bool isDangerousWithWideAvoidance
Field Value
- bool
isOnGrab
protected bool isOnGrab
Field Value
- bool
itemOwner
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public EntityCharacter itemOwner
Field Value
jointData
[TabGroup("Attachment", false, 0)]
[InfoBox("So somehow ModTK cannot draw property of AttachObj, so we setup a back reference to JointInfoData", InfoMessageType.Info, null)]
public JointInfoData jointData
Field Value
kSnapAttachDistanceThreshold
[ShowInInspector]
[SuffixLabel("Debug", false)]
public static float kSnapAttachDistanceThreshold
Field Value
- float
maxDurability
public int maxDurability
Field Value
- int
myAttachLocal
public Vector3? myAttachLocal
Field Value
myAttachLocals
[HideInInspector]
public List<Vector3> myAttachLocals
Field Value
- List<Vector3>
needCheckConnected
[TabGroup("Attachment", false, 0)]
public bool needCheckConnected
Field Value
- bool
OnAttached
public Action<EntityAttachmentItem> OnAttached
Field Value
- Action<EntityAttachmentItem>
OnEntityDisconnected
public Action OnEntityDisconnected
Field Value
- Action
previewData
public EntityAttachmentItem.TargetAttachmentPreviewData previewData
Field Value
saveId
[HideInInspector]
public int saveId
Field Value
- int
sfxDuringActivated
public SoundEvent sfxDuringActivated
Field Value
- SoundEvent
targetAttachLocal
public Vector3? targetAttachLocal
Field Value
targetAttachLocals
[HideInInspector]
public List<Vector3> targetAttachLocals
Field Value
- List<Vector3>
targetAttachRig
[NonSerialized]
[ShowInInspector]
[SuffixLabel("Debug", false)]
public Rigidbody targetAttachRig
Field Value
targetId
[HideInInspector]
public List<int> targetId
Field Value
- List<int>
twoHandTipsStr
public const string twoHandTipsStr = "TwoHandTips"
Field Value
- string
useDirectAttach
[TabGroup("Attachment", false, 0)]
public bool useDirectAttach
Field Value
- bool
Properties
DirectAttachList
Read-only access to directly attached items (for blueprint saving)
public IReadOnlyCollection<EntityAttachmentItem> DirectAttachList { get; }
Property Value
- IReadOnlyCollection<EntityAttachmentItem>
IsEquippedByCharacter
public bool IsEquippedByCharacter { get; }
Property Value
- bool
IsGripMelee
public bool IsGripMelee { get; }
Property Value
- bool
IsGripRanged
public bool IsGripRanged { get; }
Property Value
- bool
IsWeapon
public bool IsWeapon { get; }
Property Value
- bool
Methods
Activate()
public override void Activate()
Attach(Vector3, Vector3?, Quaternion)
public virtual Joint Attach(Vector3 rigTargetPos, Vector3? anchorGlobalPos, Quaternion rotation)
Parameters
rigTargetPosVector3anchorGlobalPosVector3?rotationQuaternion
Returns
Attach(Vector3, Vector3, Quaternion, Rigidbody, Vector3?, Vector3?)
public Joint Attach(Vector3 rigTargetPos, Vector3 anchorGlobalPos, Quaternion rotation, Rigidbody targetRig, Vector3? _myAttachLocal, Vector3? _targetAttachLocal)
Parameters
rigTargetPosVector3anchorGlobalPosVector3rotationQuaterniontargetRigRigidbody_myAttachLocalVector3?_targetAttachLocalVector3?
Returns
Attach(Vector3, Vector3, Quaternion, Rigidbody)
public Joint Attach(Vector3 rigTargetPos, Vector3 anchorGlobalPos, Quaternion rotation, Rigidbody targetRig)
Parameters
rigTargetPosVector3anchorGlobalPosVector3rotationQuaterniontargetRigRigidbody
Returns
AttachAs(EntityAttachmentItem)
public void AttachAs(EntityAttachmentItem other)
Parameters
otherEntityAttachmentItem
AttachPreviewUpdate(bool)
public void AttachPreviewUpdate(bool isFirstPersonPlacing)
Parameters
isFirstPersonPlacingbool
Awake()
protected override void Awake()
BreakConnection()
protected virtual void BreakConnection()
CalculateInLowSpeedUpdate()
protected void CalculateInLowSpeedUpdate()
CancelConnectionPreview()
public void CancelConnectionPreview()
CancelPreview()
public void CancelPreview()
ControlledUpdate(float)
Let's reduce the update frequency for better performance.
public override void ControlledUpdate(float deltaTime)
Parameters
deltaTimefloat
CreateBlueprintEntityDataPublic(BlueprintData)
Public wrapper for creating blueprint entity data (used by HandStateSavingBlueprint for multi-group saving)
public BlueprintEntityData CreateBlueprintEntityDataPublic(BlueprintData blueprint)
Parameters
blueprintBlueprintData
Returns
CreateConnection(EntityAttachmentItem)
public void CreateConnection(EntityAttachmentItem otherItem)
Parameters
otherItemEntityAttachmentItem
Deactivate()
public override void Deactivate()
Detach()
public virtual void Detach()
DrawAttachPointEnabledDirs()
public void DrawAttachPointEnabledDirs()
DrawAttachPointLocals()
public void DrawAttachPointLocals()
DrawAttachPoints()
public void DrawAttachPoints()
GetConnectedEntity()
public override List<Entity> GetConnectedEntity()
Returns
- List<Entity>
GetConnectionCount()
public int GetConnectionCount()
Returns
- int
GetOptimalAttachPointAndRotation(Vector3, Vector3, Entity)
public EntityAttachmentItem.TargetAttachmentPreviewData GetOptimalAttachPointAndRotation(Vector3 hitPoint, Vector3 cloestPoint, Entity targetEntity)
Parameters
Returns
HideConnectionPreviewObjects()
public void HideConnectionPreviewObjects()
HidePreviewObject()
public void HidePreviewObject()
InitializeData()
[Button]
public void InitializeData()
IsConnectedWith(Rigidbody)
public bool IsConnectedWith(Rigidbody rig)
Parameters
rigRigidbody
Returns
- bool
IsConnectedWithItem(EntityAttachmentItem)
public bool IsConnectedWithItem(EntityAttachmentItem entityAttachmentItem)
Parameters
entityAttachmentItemEntityAttachmentItem
Returns
- bool
IsUnyielding()
Check if this EntityAttachmentItem has unyielding enabled.
public bool IsUnyielding()
Returns
- bool
True if unyielding is enabled, false otherwise. Returns false if voxelDestructor is null.
OnCancelGrab()
public override void OnCancelGrab()
OnCarried(EntityCharacter)
public virtual void OnCarried(EntityCharacter character)
Parameters
characterEntityCharacter
OnDestroy()
public override void OnDestroy()
OnDisable()
public virtual void OnDisable()
OnDrawGizmosSelected()
public void OnDrawGizmosSelected()
OnEnable()
public virtual void OnEnable()
OnGrab(Rigidbody)
public override void OnGrab(Rigidbody hitRig = null)
Parameters
hitRigRigidbody
OnJointBreak(float)
public virtual void OnJointBreak(float force)
Parameters
forcefloat
OnPutDown()
public virtual void OnPutDown()
PointAttachDectection(bool)
public bool PointAttachDectection(bool isFirstPersonPlacing)
Parameters
isFirstPersonPlacingbool
Returns
- bool
RemoveConnection(EntityAttachmentItem)
public virtual void RemoveConnection(EntityAttachmentItem otherItem)
Parameters
otherItemEntityAttachmentItem
SaveBlueprintData(string)
[Button]
public void SaveBlueprintData(string saveName = null)
Parameters
saveNamestring
SetAttachLocal(EntityAttachmentItem, EntityAttachmentItem, Vector3, Vector3)
public void SetAttachLocal(EntityAttachmentItem item1, EntityAttachmentItem item2, Vector3 pos1, Vector3 pos2)
Parameters
item1EntityAttachmentItemitem2EntityAttachmentItempos1Vector3pos2Vector3
SetInvincibleTimeForConnectedEntities(float)
protected void SetInvincibleTimeForConnectedEntities(float invincibleTime = 2)
Parameters
invincibleTimefloat
SetPreviewData(Transform, Vector3, Vector3)
public void SetPreviewData(Transform target, Vector3 posFrom, Vector3 posTo)
Parameters
ShowPreviewObject()
public virtual void ShowPreviewObject()
SmartAttachTo(EntityAttachmentItem, bool)
public bool SmartAttachTo(EntityAttachmentItem other, bool snapToClosestAttachPoint = true)
Parameters
otherEntityAttachmentItemsnapToClosestAttachPointbool
Returns
- bool
Start()
protected override void Start()
TryAttachToTargetAttachmentItem()
public void TryAttachToTargetAttachmentItem()