protected virtual void Init() { if (UseAltAttack) { attackKey = ANIM_ATTACK_ALT; } else { attackKey = ANIM_ATTACK; } if (Animator == null) Animator = GetComponent<Animator>(); m_Rigidbody = GetComponent<Rigidbody>(); if (ThisByQuaterhnion == null) ThisByQuaterhnion = GetComponent<QueaternionFromTo>(); ThisByQuaterhnion.Init(null,OnComeRotation); m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; if (listForRagDoll != null) { foreach (var child in listForRagDoll) { child.isKinematic = true; } } }
protected virtual void Init() { if (Animator == null) Animator = GetComponent<Animator>(); m_Rigidbody = GetComponent<Rigidbody>(); ThisByQuaterhnion = GetComponent<QueaternionFromTo>(); ThisByQuaterhnion.Init(null,OnComeRotation); m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; }