public override void CollisionProcByFire(Collision collision, int Damage /*,Vector2 dir*/, ref FlyCollisionInfo Info, FlyDir flydir) { Role.WakeEnemy(this); Info.bVertical = true; Info.bLeft = true; Info.lifemCollision = this; Info.FlyfallSTandGridPos = new Int2(StartUnit, Layer); SkillReleaseInfo sInfo = new SkillReleaseInfo(); sInfo.m_InterruptSkill = false; sInfo.m_MakeStatus = new List <StatusType> (); sInfo.m_bImmunity = false; sInfo.m_Damage = Damage; sInfo.Result = AttackResult.Fire; ApplyDamage(sInfo, null); if (isDead) //破了 //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1003021", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, 1f); { GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "2000291", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetRotation(new Vector3(0, 0, 90)); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); //go.transform.Rotate(new Vector3(0,0,90),Space.Self); Info.flyCollisionAction = FlyCollisionAction.PauseContinueFlyDirectional; Info.bApplyDamage = true; //EffectM.LoadEffect(EffectM.sPath, "zamen_02", transform.position, null); } else //没破 { shake(); //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1003011", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, 1f); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "2000281", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetRotation(new Vector3(0, 0, 90)); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); //go.transform.Rotate(new Vector3(0,0,90),Space.Self); if (m_DefenceColider.IsInRightCollider(collision.collider)) { Info.flyCollisionAction = FlyCollisionAction.DropInBoat; Info.bApplyDamage = false; } else if (m_DefenceColider.IsInLeftCollider(collision.collider)) { Info.flyCollisionAction = FlyCollisionAction.DropInBoat; //设置左右板信息,并非移动方向 Info.HitDir = WalkDir.WALKLEFT; Info.bApplyDamage = false; } GameObjectActionExcute gae1 = EffectM.LoadEffect(EffectM.sPath, "zamen_01", m_thisT.position, null); GameObjectActionDelayDestory ndEffect1 = new GameObjectActionDelayDestory(1f); gae1.AddAction(ndEffect1); } }
public override void Update() { base.Update(); if (m_TimeCount < m_fDelay) { m_LifePrent.m_thisT.transform.position = start; return; } if (m_TimeCount < (m_fDelay + 3.02f)) { if ((m_TimeCount - m_Delatime) <= m_fDelay) { SoundPlay.Play("back_ship", false, false); //SkillEffects._instance.LoadEffect("effect/prefab/", "2000201", start, 1.5f, dolphineDir); GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", m_effectName, start, null); if (gae != null) { GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); //effectinit.SetEffectMirror(dolphineDir); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); } } Vector3 pos = bezier.GetPointAtTime((m_TimeCount - m_fDelay) / 3.0f); float Angles = NdUtil.V2toAngle(pos, bezier.GetPointAtTime((m_TimeCount - m_fDelay) / 3.0f + 0.01f), Vector3.right) + 180; m_curangle = NdUtil.ClampAngle(Angles + 180, 0, 360f); //Debug.Log(m_curangle); if (m_bRotate) { if (dolphineDir == WalkDir.WALKRIGHT) { m.SetAngle(-Angles); } else { m.SetAngle(Angles); } } PlayAction(AnimatorState.Fly00000, pos, true); //NGUIUtil.DebugLog(m_TimeCount.ToString()); //if (m_TimeCount >= 0.4f && m_TimeCount < 0.4f +Time.deltaTime) //{ // m_Skin.ProPerty.EnableTrail(true); //} } else { //PlayAction(AnimatorState.Fly00000, bezier.GetPointAtTime(1), true); //MoveAction(AnimatorState.Fly00000, Vector3.down * m_LifePrent.m_Attr.Flyspeed * Time.deltaTime, ActionMode.Delta); MoveAction(AnimatorState.Fly00000, Vector3.down * 10 * Time.deltaTime, ActionMode.Delta); } }
// Update is called once per frame void Update() { if (m_bpause) { return; } m_TimeCount += Time.deltaTime; if (m_TimeCount < m_Duration) { Vector3 pos = Vector3.Lerp(m_Start, m_Destination, m_TimeCount / m_Duration); transform.localPosition = pos; List <Life> l = new List <Life>(); CM.SearchLifeMListInBoat(ref l, LifeMType.SOLDIER, m_camp); List <Life> hit = new List <Life>(); for (int i = 0; i < l.Count; i++) { if (m_layer == l[i].GetMapPos().Layer) { if (transform.localPosition.x > (l[i].m_thisT.localPosition.x - 0.25f) && transform.localPosition.x > (l[i].m_thisT.localPosition.x + 0.25f)) { if (!l[i].m_isDead && !m_hitRole.Contains(l[i])) { m_hitRole.Add(l[i]); hit.Add(l[i]); if (m_info.m_hiteffect != 0) { pos = l[i].m_thisT.position; pos.z = -1.5f; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, m_info.m_hiteffect.ToString(), pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionEffectInit init = new GameObjectActionEffectInit(); init.SetEffectMirror(m_dir); gae.AddAction(init); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); } } } } //SkillEffects._instance.LoadEffect("effect/prefab/", m_info.m_hiteffect.ToString(),transform.position,1.5f); } m_fun(m_skillinfo, 1, hit); } else { GameObject.Destroy(gameObject); } }
public void SetCollEffect(bool bVertical) { Vector3 pos = m_Skin.tRoot.position; if (bVertical) { pos += new Vector3(0, 0.2f, 0); } else { pos += new Vector3(0.8f, -0.5f, 0); } GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "1051081", pos, BattleEnvironmentM.GetLifeMBornNode(true)); if (gae != null) { GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetRotation(new Vector3(0, 0, 90)); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.6f); gae.AddAction(ndEffect); } }
/// <summary> /// 撞击处理 /// </summary> /// <param name="Damage">撞击伤害</param> /// <param name="dir">撞击方向</param> /// <param name="Info">返回撞击信息</param> /// <returns></returns> public override void CollisionProcByFire(Collision collision, int Damage /*,Vector2 dir*/, ref FlyCollisionInfo Info, FlyDir flydir) { Role.WakeEnemy(this); Info.bVertical = true; Info.bLeft = false; Info.FlyfallSTandGridPos = new Int2(StartUnit, Layer); Info.lifemCollision = this; SkillReleaseInfo sInfo = new SkillReleaseInfo(); sInfo.m_InterruptSkill = false; sInfo.m_MakeStatus = new List <StatusType> (); sInfo.m_bImmunity = false; sInfo.m_Damage = Damage; sInfo.Result = AttackResult.Fire; ApplyDamage(sInfo, null); if (isDead) //破了 //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1003021", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, 1f); { GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "2000291", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetRotation(new Vector3(0, 0, -90)); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); GameObject go = gae.gameObject; //go.transform.Rotate(new Vector3(0,0,-90),Space.Self); Info.flyCollisionAction = FlyCollisionAction.PauseContinueFlyDirectional; Info.bApplyDamage = true; //EffectM.LoadEffect(EffectM.sPath, "zamen_02", transform.position, null); } else //没破 { shake(); //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1003011", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, 1f); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "2000281", MapGrid.GetMG(Info.FlyfallSTandGridPos).WorldPos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetRotation(new Vector3(0, 0, -90)); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); GameObject go = gae.gameObject; //go.transform.Rotate(new Vector3(0,0,-90),Space.Self); /* if (flydir == FlyDir.Left || flydir == FlyDir.LeftTop || flydir == FlyDir.LeftBottom || flydir == FlyDir.Top || flydir == FlyDir.Bottom) * { * Info.flyCollisionAction = FlyCollisionAction.DropInBoat; * Info.bApplyDamage = false; * * } * else if (flydir == FlyDir.Right || flydir == FlyDir.RightTop || flydir == FlyDir.RightBottom) * { * Info.flyCollisionAction = FlyCollisionAction.DropOutBoat; * //设置左右板信息,并非移动方向 * Info.HitDir = WalkDir.WALKLEFT; * Info.bApplyDamage = false; * } * else * { * if(m_DefenceColider.IsInLeftCollider(collision.collider)) * { * { * Info.flyCollisionAction = FlyCollisionAction.DropInBoat; * Info.bApplyDamage = false; * } * } * else if(m_DefenceColider.IsInRightCollider(collision.collider)||m_DefenceColider.IsInTopCollider(collision.collider)) * { * Info.flyCollisionAction = FlyCollisionAction.DropOutBoat; * //设置左右板信息,并非移动方向 * Info.HitDir= WalkDir.WALKRIGHT; * Info.bApplyDamage = false; * } * }*/ Info.flyCollisionAction = FlyCollisionAction.DropOutBoat; for (int i = Layer; i >= 0; i--) { MapGrid g = MapGrid.GetMG(i, StartUnit); if (g != null && (g.Type != GridType.GRID_HOLE && g.Type != GridType.GRID_HOLESTAIR)) { Info.flyCollisionAction = FlyCollisionAction.DropInBoat; break; } } Info.droppos = new Vector3(1f, 0, 0); GameObjectActionExcute gae1 = EffectM.LoadEffect(EffectM.sPath, "zamen_01", m_thisT.position, null); GameObjectActionDelayDestory ndEffect1 = new GameObjectActionDelayDestory(1f); gae1.AddAction(ndEffect1); } }
// Update is called once per frame void Update() { if (m_bpause) { return; } m_TimeCount += Time.deltaTime; if (m_type == BulletType.Missile) { Missile m = GetComponent <Missile>(); Vector3 pos = transform.localPosition; if (m_TimeCount < m_outtime) { pos = Vector3.Lerp(m_Start, m_fadeoutpos, m_TimeCount / m_outtime); transform.localPosition = pos; float Angles = NdUtil.V2toAngle(m_Start, m_fadeoutpos, Vector3.right); m.SetAngle(-Angles); } else if (m_TimeCount >= m_Duration) { //effect = SkillEffects._instance.LoadEffect("effect/prefab/", "1002061",transform.position,1.5f); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1002061", transform.position, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); effect = gae.gameObject; SoundPlay.Stop("missile_launch", false); SoundPlay.Play("missile_explosion", false, false); m_fun(m_skillinfo, 1); GameObject.Destroy(gameObject); } else { pos = myBezier.GetPointAtTime((m_TimeCount - m_outtime) / (m_Duration - m_outtime)); float Angles = NdUtil.V2toAngle(pos, myBezier.GetPointAtTime((m_TimeCount - m_outtime) / (m_Duration - m_outtime) + 0.01f), Vector3.right); m.SetAngle(-Angles); transform.localPosition = pos; } } else { if (m_TimeCount < m_Duration) { Vector3 pos = transform.localPosition; //pos.x = Mathf.Lerp(m_Start.x,m_Destination.x,m_TimeCount/ m_Duration); pos = myBezier.GetPointAtTime(m_TimeCount / m_Duration); transform.localPosition = pos; } else if (m_TimeCount >= m_Duration) { if (m_skillinfo.m_type == 1005) { if (m_TimeCount <= m_Duration + 0.5f) { Vector3 pos = transform.localPosition; pos = myBezier1.GetPointAtTime((m_TimeCount - m_Duration) / 0.5f); transform.localPosition = pos; } else if (m_TimeCount < m_Duration + 1f) { Vector3 pos = transform.localPosition; pos = myBezier2.GetPointAtTime((m_TimeCount - m_Duration - 0.5f) / 0.5f); transform.localPosition = pos; } } if (m_TimeCount >= m_Duration + m_skillinfo.m_intone_speed * 0.001f) { //Debug.Log(m_type +"," + transform.position); transform.localPosition = m_Destination; if (m_skillinfo.m_type != 1028) { m_fun(m_skillinfo, 1); } //SkillEffects._instance.LoadEffect("effect/prefab/", m_info.m_hiteffect.ToString(),transform.position,1.5f); if (m_info.m_hiteffect != 0) { Vector3 pos = transform.position; pos.z = -1.5f; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, m_info.m_hiteffect.ToString(), pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionEffectInit init = new GameObjectActionEffectInit(); init.SetEffectMirror(m_dir); gae.AddAction(init); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); } if (m_info.m_hitaudio != "") { SoundPlay.Play(m_info.m_hitaudio, false, false); } GameObject.Destroy(gameObject); } } } /*else if (m_type == BulletType.Bullet ) * { * Vector3 pos = transform.localPosition; * pos.x = Mathf.Lerp(m_Start.x,m_Destination.x,m_TimeCount/ m_Duration); * transform.localPosition = pos; * if (m_TimeCount>= m_Duration) * { * m_fun(m_skillinfo,1); * GameObject.Destroy(gameObject); * } * } * else if (m_type == BulletType.Grenade) * { * Vector3 pos = transform.localPosition; * //pos.x = Mathf.Lerp(m_Start.x,m_Destination.x,m_TimeCount/ m_Duration); * pos = myBezier.GetPointAtTime(m_TimeCount/m_Duration); * transform.localPosition = pos; * if (m_TimeCount>= m_Duration) * { * //Debug.Log(m_type +"," + transform.position); * transform.localPosition = m_Destination; * m_fun(m_skillinfo,1); * SkillEffects._instance.LoadEffect("effect/prefab/", "1002081",transform.position,1.5f); * SoundPlay.Play("grenade_explosion",false ,false); * GameObject.Destroy(gameObject); * } * } * else if (m_type == BulletType.Snowball) * { * Vector3 pos = transform.localPosition; * pos = myBezier.GetPointAtTime(m_TimeCount/m_Duration); * transform.localPosition = pos; * if (m_TimeCount>= m_Duration) * { * //Debug.Log(m_type +"," +transform.position); * transform.localPosition = m_Destination; * m_fun(m_skillinfo,1); * SkillEffects._instance.LoadEffect("effect/prefab/", "1002101",transform.position,1.5f); * GameObject.Destroy(gameObject); * } * } * else if (m_type == BulletType.Poison) * { * Vector3 pos = transform.localPosition; * pos = myBezier.GetPointAtTime(m_TimeCount/m_Duration); * transform.localPosition = pos; * //Debug.Log(m_Start + ", " + m_Destination + ", " + pos + ", " + m_TimeCount + "," + m_Duration); * if (m_TimeCount>= m_Duration) * { * //Debug.Log(m_type +"," +transform.position); * transform.localPosition = m_Destination; * m_fun(m_skillinfo,1); * SkillEffects._instance.LoadEffect("effect/prefab/", "1052031",transform.position,1f); * GameObject.Destroy(gameObject); * SoundPlay.Play("skill_money_dy",false ,false); * } * } * else if (m_type == BulletType.ling) * { * Vector3 pos = transform.localPosition; * pos = myBezier.GetPointAtTime(m_TimeCount/m_Duration); * transform.localPosition = pos; * //Debug.Log(m_Start + ", " + m_Destination + ", " + pos + ", " + m_TimeCount + "," + m_Duration); * if (m_TimeCount>= m_Duration) * { * //Debug.Log(m_type +"," +transform.position); * transform.localPosition = m_Destination; * m_fun(m_skillinfo,1); * //SkillEffects._instance.LoadEffect("effect/prefab/", "1052031",transform.position,1f); * GameObject.Destroy(gameObject); * } * } * else if (m_type == BulletType.bomb1028) * { * Vector3 pos = transform.localPosition; * pos.x = Mathf.Lerp(m_Start.x, m_Destination.x, m_TimeCount / m_Duration); * transform.localPosition = pos; * if (m_TimeCount >= m_Duration) * { * //m_fun(m_skillinfo, 1); * SkillEffects._instance.LoadEffect("effect/prefab/", "1003031", transform.position, 1.3f); * GameObject.Destroy(gameObject); * } * }*/ }
/// <summary> /// 挂载角色状态特效 /// </summary> /// <param name="EffectPos">特效挂载位置</param> /// <param name="time">特效持续时间</param> /// <param name="EffectID">特效ID ,转换成对应的特效名称</param> /// <returns>返回搜索列表list</returns> public GameObject AddStatusEffect(int EffectPos, float time, int EffectID, WalkDir dir) { if (EffectID == 1101031) //临时 { GameObject posgo = ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); Vector3 pos = posgo.transform.position; pos.z = -1f; string temp; if (dir == WalkDir.WALKLEFT) { temp = "1101031_0"; } else { temp = "1101031_1"; } GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", temp, pos, posgo.transform); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(8.5f); gae.AddAction(ndEffect); } return(null); } if (EffectID == 0) { return(null); } if (EffectPos == 1) { GameObject posgo = ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectTopPos); Vector3 pos = posgo.transform.position; pos.z = -1f; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", EffectID.ToString(), pos, posgo.transform); if (gae != null) { GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetEffectMirror(dir); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(time); gae.AddAction(ndEffect); return(gae.gameObject); } return(null); } else if (EffectPos == 2) { GameObject posgo = ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); Vector3 pos = posgo.transform.position; pos.z = -1f; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", EffectID.ToString(), pos, posgo.transform); if (gae != null) { GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetEffectMirror(dir); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(time); gae.AddAction(ndEffect); return(gae.gameObject); } return(null); } else if (EffectPos == 3) { GameObject posgo = ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); Vector3 pos = posgo.transform.position; pos.z += -2f; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", EffectID.ToString(), pos, posgo.transform); if (gae != null) { GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetEffectMirror(dir); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(time); gae.AddAction(ndEffect); return(gae.gameObject); } return(null); } else if (EffectPos == 4) { GameObject posgo = ProPerty.HelpPoint.GetVauleByKey(HelpPointName.LeyePos); Vector3 pos = posgo.transform.position; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", EffectID.ToString(), pos, posgo.transform); if (gae != null) { GameObjectActionEffectInit effectinit = new GameObjectActionEffectInit(); effectinit.SetEffectMirror(dir); gae.AddAction(effectinit); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(time); gae.AddAction(ndEffect); return(gae.gameObject); } return(null); } return(null); }