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; }
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; } }
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); } }
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; } }
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; } }
public Unit_Inventory(Unit_Base owner) { Unit = owner; }
private void Deactivate() { enabled = false; DotImage.enabled = false; TargetUnit = null; }
private void Activate(Unit_AI targetUnit) { TargetUnit = targetUnit; DotImage.enabled = true; enabled = true; }