public override void RangeTarget(List <Life> llist) { GameObject posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null) { Vector3 pos = posgo.transform.position; pos.z = -1.5f; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1004061", posgo.transform.position, posgo.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); for (int i = 0; i < llist.Count; i++) { if (llist[i].m_thisT != null) { gae = EffectM.LoadEffect(EffectM.sPath, "1004051", posgo.transform.position, m_LifePrent.GetLifeProp().transform.parent); ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); float dis = m_LifePrent.m_thisT.localPosition.x - llist[i].m_thisT.localPosition.x; gae.transform.localScale = new Vector3(dis * 0.23f, 1, 1); } } } }
void SetEffect() { if (m_type == ResourceType.Gold) { CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>(); if (Wnd != null) { Transform parent = Wnd.GetResourcePos(m_type); GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000301", parent.position, parent); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f); gae.AddAction(ndEffect); } } } else if (m_type == ResourceType.Wood) { CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>(); if (Wnd != null) { Transform parent = Wnd.GetResourcePos(m_type); GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000311", parent.position, parent); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f); gae.AddAction(ndEffect); } } } }
public void UpQualityEffect() { SetEnableQuality(true); SoundPlay.Play("hero_promotion", false, false); UpReSetUI(); Vector3 pos = new Vector3(0, -10, ConstantData.iDepBefore3DModel); GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000721", pos, MyHead.EffectParent.gameObject.transform); gae.gameObject.AddComponent <SetRenderQueue>(); if (gae != null) { GameObjectLoader.SetGameObjectLayer(gae.gameObject, MyHead.EffectParent.gameObject.layer); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2f); gae.AddAction(ndEffect); gae.gameObject.transform.localPosition = pos; } int iHpAdd = m_Info.m_hp - m_backUpBuild.m_hp; int iPower = m_Info.m_DefensePower - m_backUpBuild.m_DefensePower; AddHudTextShow(NGUIUtil.GetStringByKey(10000080) + " +" + iPower.ToString("0.00")); AddHudTextShow(NGUIUtil.GetStringByKey(10000081) + " +" + iHpAdd.ToString("0.00"), 0.8f); NGUIUtil.ExcuteWaitAction(gameObject, 1.8f, ShowUpQuilityWndCallBack); }
public override void ActiiveStart() { //NGUIUtil.DebugLog("蹦达与蹦蹦大招 天雨散弹 ActiiveStart", "orange"); //动作光效 蹦大 挥棍 SoundPlay.Play("skill_voice_boom", false, false); GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos); if (posgo != null) { GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1003061", posgo.transform.position, posgo.transform); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(m_Duration); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } else { m_effectgo = null; } } if (m_LifePrent is Role) { Pet pet = (m_LifePrent as Role).CurPet; if (pet != null && pet.PetMoveAI is PetWalk1002) { (pet.PetMoveAI as PetWalk1002).m_petState = Pet1002State.bigSkill; } } }
static void DropResourceBoxEffect(string name, sdata.s_itemtypeInfo item, Vector3 pos) { pos = BattleEnvironmentM.Local2WorldPos(pos); pos.x += 0.5f; pos.z = 0; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true)); EffectCamera.AddFollowList(gae.transform, pos); if (gae != null) { //先等待 GameObjectActionBoxWait gaw = new GameObjectActionBoxWait(2f); gae.AddAction(gaw); //open box GameObjectActionOpenBox gaopen = new GameObjectActionOpenBox(2.0f, item); gae.AddAction(gaopen); Animator ani = gae.gameObject.GetComponent <Animator>(); if (null != ani) { int nValue = (int)Random.value % 2; if (nValue == 0) { nValue = 2; } ani.SetInteger("iState", nValue); } } }
public virtual void DeadEffect() { if (this is Role) { RoleSkin skin = GetSkin() as RoleSkin; Vector3 pos = Vector3.zero; GameObject posgo = GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null) { pos = posgo.transform.position; } pos.z = 1.5f; //SkillEffects._instance.LoadEffect("effect/prefab/", "2000231",pos,1f); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "2000231", pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); } else if (this is Building) { Vector3 pos = GetPos(); pos.y += 1.5f; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "2000271", pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); } }
public void GoldCoinEffect(int num, int count) { for (int i = 0; i < num; i++) { Vector3 pos = MapGrid.GetMG(m_Attr.Pos).pos; //+new Vector3(Random.Range(1,m_Attr.Size*0.5f-2),-0.5f,1f); pos += new Vector3(0, 0.25f, 1.2f); pos = BattleEnvironmentM.Local2WorldPos(pos); int n = (int)count / num; if (i == 0) { n += count - num * ((int)count / num); } GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000041", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true)); //EffectCamera.AddFollowList(gae.transform,pos); if (gae != null) { GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0)); gae.AddAction(gaw); GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI(); gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, ResourceType.Gold); gae.AddAction(gar); GameObject coin = U3DUtil.FindChild(gae.gameObject, "coin"); if (coin != null) { coin.GetComponent <ParticleSystem>().startDelay = Random.Range(1f, 1.5f); } } } }
public override void UpdatePos() { if (m_TimeCount < m_eventtime) { PlayAction(AnimatorState.Skill01, m_Start); } else { //Vector3 pos = Vector3.Lerp(m_Start,m_End,(m_TimeCount - m_EventTime) / m_walktime ); PlayAction(AnimatorState.Skill01, m_Start); //AIPathConditions.AIPathEvent(new AIEventData(AIEvent.EVENT_SELFSP),m_LifePrent); } if (m_TimeCount > m_Effecttime && (m_TimeCount - m_Delatime) <= m_Effecttime) { GameObject posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (posgo != null) { Vector3 pos = posgo.transform.position; pos.z -= 4f; string name = "1401101_01"; if (m_LifePrent.WalkDir == WalkDir.WALKRIGHT) { name = "1401101_02"; } GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, name, pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } } }
/// <summary> /// 播放特效 /// </summary> public void PlayTrapEffect(string effectName, float deadtime) { if (m_building == null) { return; } if (m_building.m_roomType == RoomType.ResRoom) { return; } Vector3 Pos = GetWorldPos(); if (effectName == "2000651") { Pos.z -= 10; Pos.x -= MapGrid.m_width / 2; Pos.y = Pos.y - MapGrid.m_heigth / 2 + 0.3f; } else { Pos.z -= 1; } GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", effectName, Pos, BattleEnvironmentM.GetLifeMBornNode(true)); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(deadtime); gae.AddAction(ndEffect); } }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack85000, m_Start); Transform t = null; //RolePropertyM rpm = m_Skin.iGameRole.GetRolePropertyM(); GameObject goLeftHand = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.LeftHandPos); GameObject goRightHand = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.LeftHandPos); if (goLeftHand != null && goRightHand != null) { t = goLeftHand.transform; GameObjectActionExcute gaeLeftHand = EffectM.LoadEffect(EffectM.sPath, "1202031_01", t.position, t); GameObjectActionDelayDestory ndEffectL = new GameObjectActionDelayDestory(1.5f); gaeLeftHand.AddAction(ndEffectL); t = goRightHand.transform; GameObjectActionExcute gaeRightHand = EffectM.LoadEffect(EffectM.sPath, "1202031_01", t.position, t); GameObjectActionDelayDestory ndEffectR = new GameObjectActionDelayDestory(1.5f); gaeRightHand.AddAction(ndEffectR); m_effectgo = gaeRightHand.gameObject; SoundPlay.JoinPlayQueue("atc_thor", 1.5f); } GameObject goRoot = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (goRoot != null) { t = goRoot.transform; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1202031_02", t.position, t); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.5f); gae.AddAction(ndEffect); } }
public override void ActiiveStart() { PlayAction(AnimatorState.Attack87000, m_Start); string effName = m_Dir == WalkDir.WALKLEFT?"1402051_01":"1405051_02"; GameObject gpos = m_Skin.ProPerty.gameObject; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, effName, gpos.transform.position, gpos.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(3f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; GameObject gpos2 = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.LeftHandPos); GameObjectActionExcute gae2 = EffectM.LoadEffect(EffectM.sPath, "1402041", gpos2.transform.position, gpos2.transform); m_effectgo = gae.gameObject; GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null) { //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1000011",posgo.transform.position,1.5f); gae = EffectM.LoadEffect(EffectM.sPath, "1000011", posgo.transform.position, BattleEnvironmentM.GetLifeMBornNode(true)); ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; m_effectgo.transform.position += new Vector3(0, 0, -2); } }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack81000, m_Start); GameObject gpos = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos); if (gpos != null) { GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1105021_01", gpos.transform.position, gpos.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(m_Duration); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } GameObject gpos2 = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (gpos2 != null) { GameObjectActionExcute gae2 = EffectM.LoadEffect(EffectM.sPath, "1105021_02", gpos2.transform.position, gpos2.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(m_Duration); gae2.AddAction(ndEffect); m_effectgo = gae2.gameObject; } }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); if ((Parent as Role).m_Pet == null) { (Parent as Role).CreatePet(); } PlayAction(AnimatorState.Attack81000, m_Start); //动作光效 蹦大 挥棍 GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos); if (posgo != null) { GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1003061", posgo.transform.position, posgo.transform); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(m_Duration); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } } if (m_LifePrent is Role) { Pet pet = (m_LifePrent as Role).CurPet; if (pet != null && pet.PetMoveAI is PetWalk1002) { (pet.PetMoveAI as PetWalk1002).m_petState = Pet1002State.toFirePos; } } }
/// <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.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) //破了 { Info.flyCollisionAction = FlyCollisionAction.PauseContinueFlyDirectional; Info.bApplyDamage = true; EffectM.LoadEffect(EffectM.sPath, "zamen_02", m_thisT.position, null); } else //没破 { Info.flyCollisionAction = FlyCollisionAction.DropInBoat; 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 ActiiveStart() { SoundPlay.Play("skill_thor", false, false); Transform t = null; //RolePropertyM rpm = m_Skin.iGameRole.GetRolePropertyM(); // 尾巴 GameObject goTail = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.Bone1Pos); if (goTail != null) { t = goTail.transform; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1202061_01", t.position, m_LifePrent.GetLifeProp().transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); } GameObject posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (posgo != null && (m_LifePrent as Role).RoleSkill.m_AttackTarget.m_thisT != null) { Vector3 pos = posgo.transform.position; //pos.z = -1.5f; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1202061_02", posgo.transform.position, posgo.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2f); gae.AddAction(ndEffect); /*Life ttagrt = (m_LifePrent as Role).RoleSkill.m_AttackTarget; * Vector3 tpos = ttagrt.GetCenterPos(); * * float dis = Mathf.Abs(posgo.transform.position.x - tpos.x); * gae.transform.localScale = new Vector3(-dis * 0.25f, 1, 1);*/ } PlayAction(AnimatorState.Skill01, m_Start); }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack86000, m_Start); GameObject gpos = m_Skin.ProPerty.gameObject; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1402021_01", gpos.transform.position, gpos.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(3f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null) { //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1000011",posgo.transform.position,1.5f); gae = EffectM.LoadEffect(EffectM.sPath, "1000011", posgo.transform.position, BattleEnvironmentM.GetLifeMBornNode(true)); ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; m_effectgo.transform.position += new Vector3(0, 0, -2); } }
/// <summary> /// 执行攻击 /// </summary> private void DoAttack() { if (m_effect != null) { /*m_effect.DestroyEffect(); * m_effect = null;*/ GameObject.Destroy(m_effect); } GameObject.Destroy(m_effectGo); GameObject posgo = m_Owner.m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos); if (posgo != null && m_Owner.m_target != null) { GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "1003031", posgo.transform.position, m_Owner.m_target.m_thisT); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.3f); gae.AddAction(ndEffect); } } m_Owner.m_Skin.tRoot.position = m_Owner.m_Parent.GetSkin().tRoot.position; m_DoAttackFun(m_skillInfo, m_times); m_petState = Pet1002State.stand; m_CurrentAction = null; m_bGotoFirePos = false; m_bGotoAttackPos = false; }
public void AttachFx(string fx, string attachPoint, Vector3 localOffset, Vector3 localRotation, float duration) { GameObject goAttached = ProPerty.m_HelpPoint.GetVauleByKey(attachPoint); GameObjectActionExcute gae = EffectM.LoadEffect(fx, localOffset, localRotation, goAttached.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(duration); gae.AddAction(ndEffect); }
public void AttachFxWorldCoord(string fx, string attachPoint, Vector3 offset, Vector3 rotation, float duration) { GameObject goAttached = ProPerty.m_HelpPoint.GetVauleByKey(attachPoint); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, fx, goAttached.transform.position, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(duration); gae.AddAction(ndEffect); }
protected void OnBomb(object o) { GameObject.Destroy(o as GameObject); Transform tTarget = m_Skill.PropSkillInfo.m_LifeTarget.m_thisT; GameObjectActionExcute gaeTarget1919031 = EffectM.LoadEffect(EffectM.sPath, "1919031", m_posRole, tTarget); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.0f); gaeTarget1919031.AddAction(ndEffect); }
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); } }
/// <summary> /// 显示/删除 状态特效 /// </summary> /// <param name="type">眩晕、冰冻、压扁、击飞、麻痹、死亡</param> public void ShowStatusEffect(StatusType type, float duration) { if (CombatScheduler.State == CSState.End) { return; } string name = ""; switch (type) { case StatusType.Vertigo: //眩晕 U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); name = "2000691_02"; break; case StatusType.IceBuild: //冰冻 U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); name = "2000691_01"; break; case StatusType.Squash: //压扁 U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); name = "2000691_05"; break; case StatusType.ClickFly: //击飞 U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); name = "2000691_03"; break; case StatusType.paralysis: //麻痹 U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); name = "2000691_04"; break; case StatusType.Die: //死亡 U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); NGUIUtil.Change2DSpriteGray(m_soldierItem.MyHead.SprRolePhoto); break; case StatusType.None: U3DUtil.DestroyAllChild(MyHead.StatusEffectParent, true); break; default: break; } if (name != "") { GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, MyHead.StatusEffectParent.transform.position, MyHead.StatusEffectParent.transform); gae.gameObject.AddComponent <SetRenderQueue>(); GameObjectActionDelayDestory delay = new GameObjectActionDelayDestory(duration); gae.AddAction(delay); } }
public void ShowUpEffect(float duration) { GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000591_02", m_thisT.GetChild(0).position, m_thisT.GetChild(0)); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(duration); gae.AddAction(ndEffect); } }
/// <summary> /// 使命召唤触发后的特效 /// </summary> public void ShowSkill9001Effect() { GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "1000051_02", MyHead.soldierItem.transform.position, MyHead.soldierItem.transform); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2f); gae.AddAction(ndEffect); } }
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); } }
//播放区块中心爆炸效果 private void PlayStep3(string effectName, float deadtime) { Vector3 pos = Vector3.zero; foreach (BombPoint B in m_start) { if (B != null) { pos += B.GetWorldPos(); } } foreach (BombPoint B in m_linkPoint) { if (B != null) { pos += B.GetWorldPos(); } } int total = m_start.Count + m_linkPoint.Count; if (total != 0) { pos = pos / total; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", effectName, pos, BattleEnvironmentM.GetLifeMBornNode(true)); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(deadtime); gae.AddAction(ndEffect); } } //房间爆炸掉 DestroyRoom(); if (ProcessType == BombProcessType.End) { //if(m_linkCenterPoint == null || m_linkCenterPoint.Count == 0) { List <Life> l = new List <Life>(); CM.SearchLifeMListInBoat(ref l, LifeMType.BUILD, LifeMCamp.DEFENSE); foreach (Life b in l) { if (b == null) { continue; } if (b is Building && (b as Building).m_roomType == RoomType.NormalTrap) { (b as Building).KillSelf(0); } } } } }
/// <summary> /// 播放敌方来袭 /// </summary> private void PlayWarning() { GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000501_01", Vector3.zero, WndManager.GetNGUIRoot().transform); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2.0f); gae.AddAction(ndEffect); } }
public override void DoEvent() { base.DoEvent(); if (!m_skillinfo.m_LifeTarget.isDead) { Vector3 pos = m_skillinfo.m_LifeTarget.m_thisT.position; pos += new Vector3(1.5f, 1.5f, -2); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1104051", pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(180.0f); } }
/// <summary> /// 出生构造函数 /// </summary> /// <param name="Parent">出生角色</param> /// <param name="JumpTarget">跳跃的位置</param> /// <param name="JumpDir">朝向</param> /// <param name="dcb">完成回调</param> public BornActionCmd(Life Parent, Vector3 JumpTarget, WalkDir JumpDir, DoneCallBack dcb, float duration, AnimatorState state, bool bFallSmooth, string strBornEffect) { SetTarget(Parent); Transform t = m_Skin.tRoot; t.parent = BattleEnvironmentM.GetLifeMBornNode(true); m_Start = t.localPosition; m_PauseRotation = t.localRotation; m_End = JumpTarget; if (Parent.m_Attr.AttrType == 102003 || Parent.m_Attr.AttrType == 200009) { if (Parent.Anger <= 0) { t.localPosition = m_End; (Parent as Role).TurnsInto(false); m_Skin = Parent.GetSkin(); Vector3 pos = m_Skin.tRoot.position; pos.z -= 2f; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, Parent.m_Attr.AttrType == 102003 ? "1103111_01":"1401111_01", pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.0f); gae.AddAction(ndEffect); } } else if (Parent.m_Attr.AttrType == 101004) { Vector3 pos = m_Skin.tRoot.position; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1055021", pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.0f); gae.AddAction(ndEffect); } m_doneCallBack = dcb; m_Dir = JumpDir; m_Duration = duration; m_state = state; m_fPauseTime = 0f; //RolePlayAnimation(AnimatorState.Stand); //SetBornActionCmd(); if (!bFallSmooth) { m_Start = JumpTarget; } m_Skin.tRoot.rotation = Quaternion.identity; GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null && strBornEffect.Length > 0) { Vector3 pos = posgo.transform.position; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, strBornEffect, pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(duration); gae.AddAction(ndEffect); } }
/// <summary> /// 防御战 战前警报 “感叹号”敌方飞入点提示 /// </summary> private void PlayEnemyFlyHitPoint(Vector3 pos) { pos = U3DUtil.SetZ(pos, -1f); //保证特效在炮弹兵前 GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000501_02", pos, BattleEnvironmentM.GetLifeMBornNode(true)); if (gae != null) { GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); } }