Пример #1
0
 public void ScaleCapsuleForCrouching(ICommonRole roleEntitas, ref IRoleInput roleInput)
 {
     roleEntitas.IsGroundedAndCrouch = roleEntitas.IsGrounded && roleInput.IsCrouch();
     if (roleEntitas.IsGroundedAndCrouch)
     {
         if (roleInput.IsCrouching())
         {
             return;
         }
         CommonRoleMustSubgroup subgroup = roleEntitas.RoleMustSubgroup;
         subgroup.capsuleHeight      /= 2f;
         subgroup.capsuleCenter      /= 2f;
         roleEntitas.RoleMustSubgroup = subgroup;
     }
 }
Пример #2
0
        public override int SetEntitas(IShipDockEntitas target)
        {
            int id = base.SetEntitas(target);

            if (id >= 0)
            {
                mRoleItem = target as ICommonRole;

                CommonRoleMustSubgroup subgroup = mRoleItem.RoleMustSubgroup;
                SetSubgroupMap(ref mRigidbodySubgourp, subgroup.rigidbodyID);
                SetSubgroupMap(ref mRoleColliderSubgourp, subgroup.roleColliderID);
                SetSubgroupMap(ref mAnimatorSubgourp, subgroup.animatorID);
                SetSubgroupMap(ref mRoleColliderScanedSubgourp, subgroup.roleScanedColliderID);
            }

            return(id);
        }
Пример #3
0
        protected virtual void Init()
        {
            mName       = name;
            mInstanceID = GetInstanceID();

            InitRoleInputCallbacks();

            m_RoleMustSubgroup = new CommonRoleMustSubgroup
            {
                roleColliderID          = m_RoleCollider.GetInstanceID(),
                roleScanedColliderID    = m_RoleScanedCollider.GetInstanceID(),
                animatorID              = m_RoleAnimator.GetInstanceID(),
                rigidbodyID             = m_RoleRigidbody.GetInstanceID(),
                origGroundCheckDistance = mGroundCheckDistance
            };

            FreezeAllRotation(true);
            m_RoleMustSubgroup.Init(ref m_RoleCollider);
        }