示例#1
0
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if(unit == null)
            {
                unit = animator.GetComponent<Unit_Base>();
            }

            if(index == 0)
            {
                unit.UnitAnimator.Params.IsInAttackingState = true;
                unit.CombatHandler.AttackHandler.OnAttackAnimationStarted.Invoke();
            }
            else
            {
                unit.CombatHandler.AttackHandler.OnConsecutiveAttack.Invoke();
            }

            isAnimationStopping = false;
            isCrossFading = false;
            animData.IsInputReceived = false;
            animData.IsCurrentlyReceivingInput = false;

            unit.UnitAnimator.Params.IsTransitingToNextAttackAnimation = false;
            unit.CombatHandler.AttackHandler.CurrentlyPlayingCombatAnimData = animData;
        }
示例#2
0
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            unit             = animator.GetComponent <Unit_Base>();
            currentWeapon    = unit.Equipment.EquippedWeapon?.WeaponType;
            transitionTiming = (stateInfo.length * transitionTimingMultiplier) - normalizedTransitionDuration;
            isInCombatState  = unit.UnitAnimator.Params.IsInCombatState;

            isTransition2IdleMotion = false;
        }
        public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (unit == null)
            {
                unit = animator.GetComponent <Unit_Base>();
            }

            if (position == StateMachineBehaviourPosition.OnStateExit)
            {
                unit.UnitAnimator.Params.IsInAttackingState = value;
            }
        }
示例#4
0
        public Unit_Equipment(Unit_Base owner, Transform portraitTransform)
        {
            Unit = owner;
            this.portraitTransform = portraitTransform;

            equippedAttachmentDic = new Dictionary <Item_Attachment.AttachmentPart, Item_Attachment>();
            for (int i = 0; i < System.Enum.GetValues(typeof(Item_Attachment.AttachmentPart)).Length; i++)
            {
                equippedAttachmentDic.Add((Item_Attachment.AttachmentPart)i, null);
            }

            equippedArmorDic = new Dictionary <Item_Armor.ArmorPart, Item_Armor>();
            for (int i = 0; i < System.Enum.GetValues(typeof(Item_Armor.ArmorPart)).Length; i++)
            {
                equippedArmorDic.Add((Item_Armor.ArmorPart)i, null);
            }
        }
示例#5
0
        public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (unit == null)
            {
                unit = animator.GetComponent <Unit_Base>();
            }

            switch (weaponType)
            {
            case WeaponType.OneHand:
                unit.CombatHandler.DodgeHandler.SetDodgeAnimationStatus(animDodge_1H, unit.UnitAnimator.AnimStatus.DodgeDic_1H);
                break;

            case WeaponType.TwoHand:
                unit.CombatHandler.DodgeHandler.SetDodgeAnimationStatus(animDodge_2H, unit.UnitAnimator.AnimStatus.DodgeDic_2H);
                break;
            }
        }
示例#6
0
        public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (unit == null)
            {
                unit = animator.GetComponent <Unit_Base>();
            }

            Debug.Log($"OnStateExit - {weaponType}");
            switch (weaponType)
            {
            case WeaponType.OneHand:
                unit.CombatHandler.DamageReceiveHandler.SetAnimationHitStatus(animHit_1H);
                break;

            case WeaponType.TwoHand:
                unit.CombatHandler.DamageReceiveHandler.SetAnimationHitStatus(animHit_2H);
                break;
            }
        }
示例#7
0
 public Unit_Inventory(Unit_Base owner)
 {
     Unit = owner;
 }
示例#8
0
 private void Deactivate()
 {
     enabled          = false;
     DotImage.enabled = false;
     TargetUnit       = null;
 }
示例#9
0
 private void Activate(Unit_AI targetUnit)
 {
     TargetUnit       = targetUnit;
     DotImage.enabled = true;
     enabled          = true;
 }