public override void Attack(FXArgs p_fxArgs, Action p_fxFinishedCallback) { m_CommandQueue.Enqueue(delegate { m_State.ChangeState(EState.IDLE, Random.Range(0f, 0.1f)); }); m_CommandQueue.Enqueue(delegate { HandleAnimationOverrideFX(EAnimType.ATTACK, p_fxArgs); HandleMeleeFX(p_fxArgs); m_AnimationEventHandler.RegisterAnimationCallback(EAnimEventType.HIT, delegate { ChangeStateFromAttackToIdle(p_fxFinishedCallback); }); Single length = m_animator.GetCurrentAnimatorStateInfo(0).length; m_State.ChangeState(EState.ATTACK, length); m_animatorControl.Attack(); }); }
private void DrawWindow(Int32 id) { Time.timeScale = timescale; Application.targetFrameRate = targetframerate; if (m_Anim != null) { Int32 attackMagicMaxValue = m_Anim.AttackMagicMaxValue; Int32 attackMeleeMaxValue = m_Anim.AttackMeleeMaxValue; Int32 attackRangedMaxValue = m_Anim.AttackRangedMaxValue; Int32 attackCriticalMeleeMaxValue = m_Anim.AttackCriticalMeleeMaxValue; Int32 idleMaxValue = m_Anim.IdleMaxValue; Int32 evadeMaxValue = m_Anim.EvadeMaxValue; Int32 blockMaxValue = m_Anim.BlockMaxValue; Int32 hitMaxValue = m_Anim.HitMaxValue; Int32 dieMaxValue = m_Anim.DieMaxValue; Int32 eventMaxValue = m_Anim.EventMaxValue; m_Anim.InCombat = GUILayout.Toggle(m_Anim.InCombat, "InCombat", new GUILayoutOption[0]); GUILayout.Label("Attack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 i = 1; i <= attackMeleeMaxValue; i++) { if (GUILayout.Button("#" + i, new GUILayoutOption[0])) { m_Anim.Attack(i); } } GUILayout.EndHorizontal(); GUILayout.Label("AttackCritical Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 j = 1; j <= attackCriticalMeleeMaxValue; j++) { if (GUILayout.Button("#" + j, new GUILayoutOption[0])) { m_Anim.AttackCritical(j); } } GUILayout.EndHorizontal(); GUILayout.Label("RangedAttack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 k = 1; k <= attackRangedMaxValue; k++) { if (GUILayout.Button("#" + k, new GUILayoutOption[0])) { m_Anim.AttackRange(k); } } GUILayout.EndHorizontal(); GUILayout.Label("Idle Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 l = 1; l <= idleMaxValue; l++) { if (GUILayout.Button("#" + l, new GUILayoutOption[0])) { m_Anim.IdleSpecial(l); } } GUILayout.EndHorizontal(); GUILayout.Label("Evade Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 m = 1; m <= evadeMaxValue; m++) { if (GUILayout.Button("#" + m, new GUILayoutOption[0])) { m_Anim.Evade(m); } } GUILayout.EndHorizontal(); GUILayout.Label("Hit Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 n = 1; n <= hitMaxValue; n++) { if (GUILayout.Button("#" + n, new GUILayoutOption[0])) { m_Anim.Hit(n); } } GUILayout.EndHorizontal(); GUILayout.Label("Event Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num = 2; num <= eventMaxValue; num++) { if (GUILayout.Button("#" + (num - 1), new GUILayoutOption[0])) { m_Anim.EventSummon(num); } } GUILayout.EndHorizontal(); GUILayout.Label("Block Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num2 = 1; num2 <= blockMaxValue; num2++) { if (GUILayout.Button("#" + num2, new GUILayoutOption[0])) { m_Anim.Block(num2); } } GUILayout.EndHorizontal(); GUILayout.Label("MagicAttackAnimations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num3 = 1; num3 <= attackMagicMaxValue; num3++) { if (GUILayout.Button("#" + num3, new GUILayoutOption[0])) { m_Anim.AttackMagic(num3); } } GUILayout.EndHorizontal(); GUILayout.Label("Die Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num4 = 1; num4 <= dieMaxValue; num4++) { if (GUILayout.Button("#" + num4, new GUILayoutOption[0])) { m_Anim.Die(num4); } } GUILayout.EndHorizontal(); GUILayout.Label("Movement/Turn Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("StartPosition", new GUILayoutOption[0])) { Quaternion lookDirection = Quaternion.Euler(0f, 0f, 0f); Vector3 position = new Vector3(0f, 0f, 0f); m_Anim.MoveTo(position, lookDirection); } if (GUILayout.Button("LeftPosition", new GUILayoutOption[0])) { Vector3 position2 = new Vector3(20f, 0f, 0f); m_Anim.MoveTo(position2, transform.rotation); } if (GUILayout.Button("RightPosition", new GUILayoutOption[0])) { Vector3 position3 = new Vector3(-10f, 0f, 0f); m_Anim.MoveTo(position3, transform.rotation); } if (GUILayout.Button("BackPosition", new GUILayoutOption[0])) { Vector3 position4 = new Vector3(0f, 0f, -10f); m_Anim.MoveTo(position4, transform.rotation); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("Rotate Left", new GUILayoutOption[0])) { m_MonsterRotation = transform.rotation; m_Degree = RotationValueHandler(-90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } if (GUILayout.Button("Rotate Right", new GUILayoutOption[0])) { m_MonsterRotation = transform.rotation; m_Degree = RotationValueHandler(90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } GUILayout.EndHorizontal(); GUILayout.Label("IsMoving: " + m_Anim.IsMoving, new GUILayoutOption[0]); GUILayout.Label("IsRotating: " + m_Anim.IsRotating, new GUILayoutOption[0]); GUILayout.Label("InMovement: " + m_Anim.InMovement, new GUILayoutOption[0]); GUILayout.Label("IsDead: " + m_Anim.IsDead, new GUILayoutOption[0]); GUILayout.Label("InCombat: " + m_Anim.InCombat, new GUILayoutOption[0]); } }
private void TabMonsterAnimation() { if (m_Main.ActiveMonsterAnimationHandler != null) { Int32 attackMagicMaxValue = m_Anim.AttackMagicMaxValue; Int32 attackMeleeMaxValue = m_Anim.AttackMeleeMaxValue; Int32 attackRangedMaxValue = m_Anim.AttackRangedMaxValue; Int32 attackCriticalMeleeMaxValue = m_Anim.AttackCriticalMeleeMaxValue; Int32 idleMaxValue = m_Anim.IdleMaxValue; Int32 evadeMaxValue = m_Anim.EvadeMaxValue; Int32 blockMaxValue = m_Anim.BlockMaxValue; Int32 hitMaxValue = m_Anim.HitMaxValue; Int32 dieMaxValue = m_Anim.DieMaxValue; Int32 eventMaxValue = m_Anim.EventMaxValue; m_IdleRota = GUILayout.Toggle(m_IdleRota, "Switch On/Off Idle Rota", new GUILayoutOption[0]); if (!m_IdleRota) { m_Main.ActiveMonsterView.NumberOfIdleAnimations = 0; } else { m_Main.ActiveMonsterView.NumberOfIdleAnimations = idleMaxValue; } m_Anim.InCombat = GUILayout.Toggle(m_Anim.InCombat, "InCombat", new GUILayoutOption[0]); GUILayout.Label("Attack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 i = 1; i <= attackMeleeMaxValue; i++) { if (GUILayout.Button("#" + i, new GUILayoutOption[0])) { m_Anim.Attack(i); } } GUILayout.EndHorizontal(); GUILayout.Label("AttackCritical Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 j = 1; j <= attackCriticalMeleeMaxValue; j++) { if (GUILayout.Button("#" + j, new GUILayoutOption[0])) { m_Anim.AttackCritical(j); } } GUILayout.EndHorizontal(); GUILayout.Label("RangedAttack Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 k = 1; k <= attackRangedMaxValue; k++) { if (GUILayout.Button("#" + k, new GUILayoutOption[0])) { m_Anim.AttackRange(k); } } GUILayout.EndHorizontal(); GUILayout.Label("Idle Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 l = 1; l <= idleMaxValue; l++) { if (GUILayout.Button("#" + l, new GUILayoutOption[0])) { m_Anim.IdleSpecial(l); } } GUILayout.EndHorizontal(); GUILayout.Label("Evade Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 m = 1; m <= evadeMaxValue; m++) { if (GUILayout.Button("#" + m, new GUILayoutOption[0])) { m_Anim.Evade(m); } } GUILayout.EndHorizontal(); GUILayout.Label("Hit Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 n = 1; n <= hitMaxValue; n++) { if (GUILayout.Button("#" + n, new GUILayoutOption[0])) { m_Anim.Hit(n); } } GUILayout.EndHorizontal(); GUILayout.Label("Event Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num = 2; num <= eventMaxValue; num++) { if (GUILayout.Button("#" + (num - 1), new GUILayoutOption[0])) { m_Anim.EventSummon(num); } } GUILayout.EndHorizontal(); GUILayout.Label("Block Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num2 = 1; num2 <= blockMaxValue; num2++) { if (GUILayout.Button("#" + num2, new GUILayoutOption[0])) { m_Anim.Block(num2); } } GUILayout.EndHorizontal(); GUILayout.Label("MagicAttackAnimations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num3 = 1; num3 <= attackMagicMaxValue; num3++) { if (GUILayout.Button("#" + num3, new GUILayoutOption[0])) { m_Anim.AttackMagic(num3); } } GUILayout.EndHorizontal(); GUILayout.Label("Die Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); for (Int32 num4 = 1; num4 <= dieMaxValue; num4++) { if (GUILayout.Button("#" + num4, new GUILayoutOption[0])) { m_Anim.Die(num4); } } GUILayout.EndHorizontal(); GUILayout.Label("Movement/Turn Animations:", new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("StartPosition", new GUILayoutOption[0])) { m_Anim.MoveTo(transform.position, transform.rotation); } if (GUILayout.Button("LeftPosition", new GUILayoutOption[0])) { Vector3 position = new Vector3(10f, 0f, 0f); m_Anim.MoveTo(position, transform.rotation); } if (GUILayout.Button("RightPosition", new GUILayoutOption[0])) { Vector3 position2 = new Vector3(-10f, 0f, 0f); m_Anim.MoveTo(position2, transform.rotation); } if (GUILayout.Button("BackPosition", new GUILayoutOption[0])) { Vector3 position3 = new Vector3(0f, 0f, -10f); m_Anim.MoveTo(position3, transform.rotation); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button("Rotate Left", new GUILayoutOption[0])) { m_MonsterRotation = m_Main.ActiveMonster.transform.rotation; m_Degree = RotationValueHandler(-90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } if (GUILayout.Button("Rotate Right", new GUILayoutOption[0])) { m_MonsterRotation = m_Main.ActiveMonster.transform.rotation; m_Degree = RotationValueHandler(90f); m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f); m_Anim.RotateTo(m_MonsterRotation); } GUILayout.EndHorizontal(); } }