IEnumerator CareAttack() { //播放前摇动作 PlayAnim("Skill1"); //等待升空 yield return(new WaitForSeconds(0.6f)); CurrentSkeleton.AnimationState.TimeScale = 0; //播放特效 AttackPos.SetBone("s_g"); AttackPos.Initialize(); EventManager.Send <Vector3>("HeroCarePlay", AttackPos.transform.localPosition + AttackPos.transform.parent.localPosition); EventManager.Send <Vector3>("HeroAimPlay", Vector3.zero); yield return(new WaitForSeconds(1.0f)); //产生箭矢 AttackPos.SetBone("s_g"); AttackPos.Initialize(); CurrentSkeleton.AnimationState.TimeScale = 1; CreateArrow(2, TargetType.Enemy); //回归普通攻击 yield return(new WaitForSeconds(0.5f)); ResetAttackMode(); RandomAttack(); }
/// <summary> /// 剑雨前摇 /// </summary> /// <returns></returns> IEnumerator ArrowRainStand() { //进入待机 StandBy(0); yield return(new WaitForSeconds(0.3f)); //播放魔法动画 AttackPos.SetBone("z_g"); AttackPos.Initialize(); EventManager.Send <bool>("HeroMagicSet", true); EventManager.Send <float>("HeroMagicTime", 10.0f); EventManager.Send <int>("HeroMagicMode", 1); EventManager.Send <Vector3>("HeroMagicPlay", AttackPos.transform.localPosition + AttackPos.transform.parent.localPosition); yield return(new WaitForSeconds(1.0f)); //播放攻击动画 PlayAnim("Skill4"); //特效跟随 float followTime = 0; AttackPos.SetBone("s_g"); while (followTime < 0.15f) { yield return(null); followTime += Time.deltaTime; AttackPos.Initialize(); EventManager.Send <Vector3>("HeroMagicPos", AttackPos.transform.localPosition + AttackPos.transform.parent.localPosition); } }
/// <summary> /// 延时创建 /// </summary> /// <param name="waitTime">等待时间</param> /// <param name="arrowType">箭矢类型</param> /// <returns></returns> IEnumerator DelayCreate(float waitTime, int arrowType) { yield return(new WaitForSeconds(waitTime)); AttackPos.SetBone("z_weapon"); AttackPos.Initialize(); CreateArrow(arrowType, TargetType.Enemy); }
/// <summary> /// 等待播放附魔动画 /// </summary> /// <returns></returns> IEnumerator WaitPlayMagicEffect() { //等待到达位置 yield return(new WaitForSeconds(0.4f)); //展示附魔动画 CurrentSkeleton.AnimationState.TimeScale = 0; AttackPos.SetBone("d_g"); AttackPos.Initialize(); EventManager.Send <float>("HeroMagicTime", 2.5f); EventManager.Send <bool>("HeroMagicSet", true); EventManager.Send <int>("HeroMagicMode", 0); EventManager.Send <Vector3>("HeroMagicPlay", AttackPos.transform.localPosition + AttackPos.transform.parent.localPosition); yield return(new WaitForSeconds(2.0f)); //恢复动作 CurrentSkeleton.AnimationState.TimeScale = 1; }
/// <summary> /// 产生箭矢 /// </summary> /// <param name="animName">动画名称</param> private void CreateArrow(string animName) { if (debug) { Debug.Log("产生箭矢" + animName); } //AttackPos.SetBone("s_g"); //AttackPos.Initialize(); switch (animName) { case "attack2": AttackPos.SetBone("s_g"); AttackPos.Initialize(); switch (heroAttackMode) { case HeroAttackMode.Special: EventManager.Send <Vector3>("HeroWindMagic", AttackPos.transform.localPosition + AttackPos.transform.parent.localPosition); CreateArrow(1, TargetType.Enemy); break; case HeroAttackMode.Normal: CreateArrow(0, TargetType.Enemy); break; } break; case "attack": AttackPos.SetBone("s_g"); AttackPos.Initialize(); CreateArrow(1, TargetType.Enemy); break; case "Skill1": //AttackPos.SetBone("s_g"); //AttackPos.Initialize(); //createArrowCoroutine = StartCoroutine(DelayCreate(0.7f, 2)); break; } }
public override void StopSpecial() { base.StopSpecial(); AttackPos.SetBone("s_g"); AttackPos.Initialize(); }