예제 #1
0
        private IEnumerator PlayActionAnimationRoutine(AnimActionType animActionType, int skillOrWeaponTypeDataId, int index)
        {
            this.animActionType = animActionType;
            float playSpeedMultiplier = 1f;

            switch (animActionType)
            {
            case AnimActionType.AttackRightHand:
                playSpeedMultiplier = CacheAtkSpeed;
                // Set doing action state at clients and server
                isAttackingOrUsingSkill = true;
                // Calculate move speed rate while doing action at clients and server
                moveSpeedRateWhileAttackOrUseSkill = 1f;
                if (EquipWeapons != null && EquipWeapons.rightHand != null && EquipWeapons.rightHand.GetWeaponItem() != null)
                {
                    moveSpeedRateWhileAttackOrUseSkill = EquipWeapons.rightHand.GetWeaponItem().moveSpeedRateWhileAttacking;
                }
                break;

            case AnimActionType.AttackLeftHand:
                playSpeedMultiplier = CacheAtkSpeed;
                // Set doing action state at clients and server
                isAttackingOrUsingSkill = true;
                // Calculate move speed rate while doing action at clients and server
                moveSpeedRateWhileAttackOrUseSkill = 1f;
                if (EquipWeapons != null && EquipWeapons.leftHand != null && EquipWeapons.leftHand.GetWeaponItem() != null)
                {
                    moveSpeedRateWhileAttackOrUseSkill = EquipWeapons.leftHand.GetWeaponItem().moveSpeedRateWhileAttacking;
                }
                break;

            case AnimActionType.Skill:
                // Set doing action state at clients and server
                isAttackingOrUsingSkill = true;
                // Calculate move speed rate while doing action at clients and server
                moveSpeedRateWhileAttackOrUseSkill = 1f;
                if (GameInstance.Skills.ContainsKey(skillOrWeaponTypeDataId))
                {
                    moveSpeedRateWhileAttackOrUseSkill = GameInstance.Skills[skillOrWeaponTypeDataId].moveSpeedRateWhileUsingSkill;
                }
                break;

            case AnimActionType.ReloadLeftHand:
            case AnimActionType.ReloadRightHand:
                // Set doing action state at clients and server
                isAttackingOrUsingSkill = true;
                // Calculate move speed rate while doing action at clients and server
                moveSpeedRateWhileAttackOrUseSkill = 1f;
                break;
            }
            if (CharacterModel != null)
            {
                yield return(CharacterModel.PlayActionAnimation(animActionType, skillOrWeaponTypeDataId, index, playSpeedMultiplier));
            }
            // Set doing action state at clients and server
            this.animActionType     = AnimActionType.None;
            isAttackingOrUsingSkill = false;
        }
예제 #2
0
        private IEnumerator PlayActionAnimationRoutine(AnimActionType animActionType, int dataId, int index)
        {
            var playSpeedMultiplier = 1f;

            switch (animActionType)
            {
            case AnimActionType.AttackRightHand:
            case AnimActionType.AttackLeftHand:
                playSpeedMultiplier = CacheAtkSpeed;
                break;
            }
            if (CharacterModel != null)
            {
                yield return(CharacterModel.PlayActionAnimation(animActionType, dataId, index, playSpeedMultiplier));
            }
            this.animActionType = AnimActionType.None;
        }