예제 #1
0
파일: BaseControl.cs 프로젝트: Kinderril/p3
    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;
            }
        }
    }
예제 #2
0
 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;
     
 }