void Awake() { m_State.Init(this); m_PrevLength = m_Length; m_CapsuleTransform.SetLength(m_Length, CapsuleResizeMethod.FromCenter); m_CapsuleTransform.m_CapsuleCollider = this; m_CapsuleTransform.SetPosition(transform.position); m_CapsuleTransform.SetUpDirection(transform.up); UpdateContextInfo(); if ((1 << gameObject.layer & m_LayerMask.value) != 0) { Debug.LogError("ControlledCapsuleCollider Layermask will hit the player itself! Please uncheck the \"" + LayerMask.LayerToName(gameObject.layer) + "\" layer in the ControlledCapsuleCollider collision LayerMask, or switch the player GameObject layer to one not covered by that LayerMask"); } }
public void ApplyEntireMovement(CapsuleTransform a_Transform) { if (a_Transform.GetPosition() != m_Position) { a_Transform.SetPosition(m_Position); } if (a_Transform.GetUpDirection() != m_UpDirection) { a_Transform.Rotate(m_UpDirection, m_RotateMethod); } if (a_Transform.GetLength() != m_Length) { a_Transform.SetLength(m_Length, m_ResizeMethod); } }