public GridActionDophineFly(Life Parent, WalkDir Dir, float duration, float delay, Vector3 v3SpawnWater) { m_fDelay = delay; m_v3SpawnWater = v3SpawnWater; if (Parent.m_Attr.AttrType == 100003 || Parent.m_Attr.AttrType == 101002) { m_bRotate = false; } start = Vector3.zero; Vector3 end = Vector3.zero; if (BattleEnvironmentM.GetDolphineLine(Dir, ref start, ref end) == false) { return; } if (v3SpawnWater != Vector3.zero) { start = v3SpawnWater; } //海豚顶特效 这里的Dir是炮弹兵被顶飞的方向 dolphineDir = (Dir == WalkDir.WALKLEFT ? WalkDir.WALKRIGHT : WalkDir.WALKLEFT); if (Dir == WalkDir.WALKRIGHT) { m_effectName = "2000201_01"; } else { m_effectName = "2000201_02"; } SetTarget(Parent); m = Parent.m_thisT.gameObject.AddComponent <Missile>(); m.m_bParticleRotate = false; //分支 Parent.m_thisT.rotation = Quaternion.identity; //保证左侧顶飞头部着地 if (Dir == WalkDir.WALKLEFT) { Dir = WalkDir.WALKRIGHT; } SoundPlay.Play("drop_sea", false, false); base.SetData(start, end, RoleState.HITFLY, duration, -1, dolphineDir, 0); bezier = new Bezier(start, new Vector3(0, 25, 0), new Vector3(0, 25, 0), end); (Parent.MoveAI as Fly).m_FlyInfo.Reset(); }
public override void ActiiveStart() { SoundPlay.Play("skill_thor", false, false); Transform t = null; //RolePropertyM rpm = m_Skin.iGameRole.GetRolePropertyM(); GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.Bone1Pos); if (posgo != null) { t = posgo.transform; //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1001081",t.position,0.75f,true); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1055071_01", t.position, m_LifePrent.GetLifeProp().transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); //m_effectgo = gae.gameObject; } GameObject posgo2 = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.Bone2Pos); if (posgo2 != null) { t = posgo2.transform; //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1001081",t.position,0.75f,true); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1055071_02", t.position, t); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); //m_effectgo = gae.gameObject; } GameObject posgo3 = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.Bone3Pos); if (posgo3 != null) { t = posgo3.transform; Vector3 r = new Vector3(0, 180f, 0); //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1001081",t.position,0.75f,true); GameObjectActionExcute gae = EffectM.LoadEffect("1055071_02", Vector3.zero, r, t); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); //m_effectgo = gae.gameObject; } }
public override void ActiiveStart() { SoundPlay.Play("skill_duang", false, false); Transform t = null; RolePropertyM rpm = (m_Skin as RoleSkin).GetRolePropertyM(); GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (posgo != null) { t = posgo.transform; //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1001081",t.position,0.75f,true); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, m_LifePrent.WalkDir == WalkDir.WALKLEFT? "1001111_01" : "1001111_02", t.position, t); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(m_Duration); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } }
/// <summary> /// 升级特效 /// </summary> public void UpLevelEffect() { SoundPlay.Play("hero_promotion", false, false); Vector3 pos = new Vector3(0, -10, ConstantData.iDepBefore3DModel); GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000711", 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; } UpReSetUI(); }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack85000, m_Start); SoundPlay.Play(m_LifePrent.m_Attr.ModelType.ToString() + "_atc", false, false); Transform t = null; //RolePropertyM rpm = m_Skin.iGameRole.GetRolePropertyM(); GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.FirePos); if (posgo != null) { t = posgo.transform; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1201021", t.position, t); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack85000, m_Start); SoundPlay.Play("atc_hulk", false, false); GameObject posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (posgo != null) { Vector3 pos = posgo.transform.position; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1401061", pos, posgo.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } }
public override void ActiiveStart() { SoundPlay.Play(m_LifePrent.m_Attr.ModelType.ToString() + "_skill", false, false); Transform t = null; //RolePropertyM rpm = m_Skin.iGameRole.GetRolePropertyM(); GameObject posgo = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (posgo != null) { t = posgo.transform; //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1001081",t.position,0.75f,true); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1201041", t.position, m_LifePrent.GetLifeProp().transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(1.5f); gae.AddAction(ndEffect); //m_effectgo = gae.gameObject; } }
/// <summary> /// Call the listener function. /// </summary> protected virtual void OnClick() { if (current == null && isEnabled) { current = this; //EventDelegate.Execute(onClick); if (IsPlaySound) { SoundPlay.Play("click", false, false); } if (OnClickEventHandler != null) { OnClickEventHandler(current); } current = null; } }
public override void ActiiveStart() { SoundPlay.Play("skill_voice_bear", false, false); /*MapGrid gfrom = m_LifePrent.GetMapGrid(); * m_Start = m_Skin.tRoot.localPosition; * DIR dir = m_Dir == WalkDir.WALKLEFT ? DIR.LEFT : DIR.RIGHT; * * MapGrid gto = gfrom; * //w.m_Attr.Speed * while(Mathf.Abs(gto.GridPos.Unit - gfrom.GridPos.Unit) <= (m_LifePrent.m_Attr.Speed * (m_Duration- m_EventTime))) * { * MapGrid g = gto.GetNextAttackStation(dir,false); * if(g != null) * { * List<int> lr = new List<int>(); * g.GetRoleList(ref lr); * if (lr.Count > 1 || g.Type == GridType.GRID_HOLE || g.Type == GridType.GRID_WALL) * { * break; * } * else * { * if (lr.Count == 1 && lr[0] != m_LifePrent.m_SceneID) * break; * else * gto = g; * } * } * else * break; * } * if (gto != null) * { * m_End = gto.pos; * //w.Teleport(gto); * } * else * m_End = m_Start; * m_walktime = Mathf.Abs(gto.GridPos.Unit - gfrom.GridPos.Unit)/ m_LifePrent.m_Attr.Speed;*/ /* MapGrid gl = gfrom.GetNextAttackStation(DIR.LEFT,false); * MapGrid gr = gfrom.GetNextAttackStation(DIR.RIGHT,false);*/ }
public override void DoEvent() { base.DoEvent(); if (m_LifePrent.m_Attr.IsHide) { if ((m_LifePrent as Role).Target is Role) { GameObject posgo = (m_LifePrent as Role).Target.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null) { //GameObject go = SkillEffects._instance.LoadEffect("effect/prefab/", "1051151",posgo.transform.position,1f,true); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1051061", posgo.transform.position, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.6f); gae.AddAction(ndEffect); } } } SoundPlay.Play("act_yidao", false, false); }
public override void Hit(int damage) { SetAnimator(Build_AnimatorState.Hit20000); if (damage < 0) { SoundPlay.Play("coin_hit", false, false); SpawnJinkuHit(); int loss = CalcSubGold(-damage); CmCarbon.SetAddWinGold(loss); SetAnimator(Build_AnimatorState.Hit20000); sdata.s_resourcedropInfo Info = ConfigM.GetBuildSourceDropIRow((int)ResourceType.Gold, loss); if (Info != null) { int num = Info.num1; GoldCoinEffect(num, loss); } } //base.Hit(damage); }
public void SetTreasureResult(treasure.TreasureRobSettleResponse Info) { bool win = Info.win; battle.SettleResponse pvpInfo = Info.pvpinfo; m_IsPve = false; if (Info == null) { return; } // if(MyHead.m_pvp != null) // MyHead.m_pvp.SetActive(true); if (MyHead.btnrecombat != null) { MyHead.btnrecombat.gameObject.SetActive(false); } if (win) { SoundPlay.Play("win", false, false); SetteamReward(pvpInfo); SetStageWin(win, pvpInfo.star); List <SoldierInfo> lSoldier = new List <SoldierInfo>(); CmCarbon.GetPlayerSoldier(ref lSoldier); SetSoldierReward(lSoldier); } else { SoundPlay.Play("battle_lose", false, false); SetteamReward(pvpInfo); if (MyHead.PvpPveFail != null) { MyHead.PvpPveFail.SetActive(true); MyHead.fail.gameObject.SetActive(true); MyHead.Data.SetActive(false); MyHead.succ.gameObject.SetActive(false); MyHead.Rewardtable.transform.parent.gameObject.SetActive(false); } } DoFailJumb(); }
public void SetSkillInfo(Vector3 dest, DoAttackFun fun, float speed, WalkDir dir, Vector3 outpos, Vector3 inpos, BulletType t, SoldierSkill skill) { SetInfo(dest, fun, speed, dir, t, skill, false); SoundPlay.Play("missile_launch", false, false); m_fadeinpos = inpos; m_fadeoutpos = outpos; m_fadeoutpos.z = 1.5f; m_Skill = true; m_outtime = 0.3f; //Vector3.Distance(transform.localPosition,outpos) /speed; m_intime = Vector3.Distance(inpos, dest) / speed; m_Duration = 1.3f; //m_outtime + m_intime; Vector3 pos = transform.localPosition; //myBezier = new Bezier( m_fadeoutpos, new Vector3(0,-10,0), new Vector3(0,-10,0), m_Destination ); myBezier = new Bezier(m_fadeoutpos, new Vector3(0, -m_info.m_locus, 0), new Vector3(0, -m_info.m_locus, 0), m_Destination); //UnityEditor.Handles.DrawBezier(m_fadeoutpos, m_Destination, new Vector3(0, -10, 0), new Vector3(0, -10, 0), // Color.red, null, 1f); //Debug.Log(m_Start +","+m_fadeoutpos +","+m_fadeinpos +","+m_Destination); //Debug.Log( m_fadeoutpos+","+ new Vector3(m_fadeoutpos.x,m_fadeoutpos.y -10,m_fadeoutpos.z)+","+ new Vector3(m_Destination.x,m_Destination.y -10,m_Destination.z)+","+ m_Destination); //Debug.Log("bullet:" + transform.localPosition + "," +m_Destination + "," + m_Speed + "," + m_Duration + ","+Mathf.Abs(transform.localPosition.x - m_Destination.x)); }
public void ReleaseGodSkill(MapGrid g, Vector3 pos) { m_ReleaseTimes++; m_targetg = g; m_targetpos = pos; if (m_godskill.m_type == 9000) { GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1000041_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true)); EffectCamera.AddFollowList(gae.transform, pos); //gae.gameObject.transform.localPosition = new Vector3(gae.gameObject.transform.localPosition.x,gae.gameObject.transform.localPosition.y,gae.gameObject.transform.localPosition.z-1f); GameObjectActionGodSkill9000 ndEffect = new GameObjectActionGodSkill9000(); ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime); //ndEffect.m_complete = DoGodSkill; SoundPlay.Play("apocalypse_missile_01", false, false); SoundPlay.JoinPlayQueue("apocalypse_missile_02", 0f); SoundPlay.JoinPlayQueue("apocalypse_missile_03", 0.0f); gae.AddAction(ndEffect); } else if (m_godskill.m_type == 9001) { //NGUIUtil.DebugLog("使命召唤表现"); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1000051_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionGodSkill9001 ndEffect = new GameObjectActionGodSkill9001(); ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime); if (m_listSkillTarget.Count > 0) { Life lifeTarget = m_listSkillTarget[0]; ndEffect.SkillTarget = lifeTarget; } SoundPlay.Play("call_of_duty", false, false); gae.AddAction(ndEffect); } else if (m_godskill.m_type == 9002) { DoGodSkill(); } }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack85000, m_Start); SoundPlay.Play("atc_viking", false, false); if (m_LifePrent.m_Status.HaveState(StatusType.Berserker)) { GameObject gpos = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1104031", gpos.transform.position, gpos.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(180.0f); m_effectgo = gae.gameObject; } else { GameObject gpos = m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1104021", gpos.transform.position, gpos.transform); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(180.0f); m_effectgo = gae.gameObject; } }
/// <summary> /// 释放技能主逻辑 /// </summary> protected override bool ReleaseSkill(ref List <Life> RoleList, ref int nAttackIndex) { bool IsRelease = false; if (RoleList.Count > 0) { IsRelease = true; SoundPlay.Play("Trap/trap_sunkens", false, false); foreach (Life w in RoleList) { bool InterruptSkill = false; GridActionCmd action = null; if (w is Role) { action = (w as Role).CurrentAction; } SkillReleaseInfo Info = m_Skill.SkillRelease(this, w, action, m_Skill.PropSkillInfo); w.ApplyDamage(Info, m_thisT); } } return(IsRelease); }
public override void ActiiveStart() { Life w = m_LifePrent.m_Skill.m_SkillTarget; if (w != null) { GameObject posgo = m_LifePrent.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectBottomPos); if (posgo != null) { float fDistance = ((m_LifePrent as Role).m_thisT.position.x - w.m_thisT.position.x); fDistance = fDistance < 0?-fDistance:fDistance; Vector3 pos = posgo.transform.position; GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1054071", posgo.transform.position, posgo.transform); Vector3 scale = gae.transform.localScale; //scale.x= fDistance/2.4f; gae.transform.localScale = scale; GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(4f); gae.AddAction(ndEffect); } Vector3 pos1 = w.m_thisT.position; if (w is Role) { posgo = w.GetSkin().ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); pos1 = posgo.transform.position; } else { pos1 += new Vector3(0, 2, 0); } //if (posgo != null) { GameObjectActionExcute gaeTarget = EffectM.LoadEffect(EffectM.sPath, "1054081", pos1, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffectTarget = new GameObjectActionDelayDestory(4f); gaeTarget.AddAction(ndEffectTarget); SoundPlay.Play("skill_maonv", false, false); } } }
protected override void TriggerSkillTime(ref List <Life> RoleList, ref float fReleaseDelay) { fReleaseDelay = 0.0f; if (RoleList.Count > 0) { SoundPlay.Play("Trap/trap_ejection", false, false); Life lRole = RoleList [0]; Vector3 end = Vector3.zero; m_dir = GetDir(lRole); switch (m_dir) { case WalkDir.WALKLEFT: SetAnimator(Build_AnimatorState.Stand10000); SetAnimator(Build_AnimatorState.Trigger30100); break; case WalkDir.WALKRIGHT: SetAnimator(Build_AnimatorState.Stand10000); SetAnimator(Build_AnimatorState.Trigger30000); break; } } }
public void UpStarEffect() { for (int i = 0; i < MyHead.SprStars.Length; i++) { if (MyHead.SprStars[i].spriteName == "icon033") { Vector3 pos = MyHead.SprStars[i].transform.localPosition; GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000741", pos, MyHead.SprStars[i].transform.parent); gae.gameObject.AddComponent <SetRenderQueue>(); if (gae != null) { GameObjectLoader.SetGameObjectLayer(gae.gameObject, MyHead.SprStars[i].transform.parent.gameObject.layer); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(2f); gae.AddAction(ndEffect); gae.gameObject.transform.localPosition = pos; } MyHead.SprStars[i].spriteName = "icon032"; SoundPlay.Play("hero_promotion", false, false); break; } } }
void ShipBomb(bool win) { bool isDelayPlaySound = false; Transform t = BattleEnvironmentM.GetLifeMBornNode(true); if (CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE) == false && win == true) { ShipBombAction action = t.gameObject.AddComponent <ShipBombAction>(); action.SetFinishFun(ShowEndTalk, win); isDelayPlaySound = true; } else if (CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE) == true && win == false) { ShipBombAction action = t.gameObject.AddComponent <ShipBombAction>(); action.SetFinishFun(ShowEndTalk, win); isDelayPlaySound = true; } else if (CmCarbon.GetCamp2Player(LifeMCamp.DEFENSE) && win) { DefenseEndAction action = t.gameObject.AddComponent <DefenseEndAction>(); action.SetFinishFun(ShowEndTalk, win); isDelayPlaySound = true; } else { ShowEndTalk(win); } if (win) { SoundPlay.Play("battle_win", false, false, isDelayPlaySound ? 5f : 0f); } else { SoundPlay.Play("battle_lose", false, false, isDelayPlaySound ? 5f : 0f); } }
public void HitSound(Life lifeM, Life Attacker) { if (lifeM is IggFloor) { if (Attacker.m_Attr.AttrType == 100002 || Attacker.m_Attr.AttrType == 200001) { SoundPlay.Play("hit_deck_rui", false, false); } else if (Attacker.m_Attr.AttrType == 100003) { SoundPlay.Play("hit_deck_rui", false, false); } else if (Attacker.m_Attr.AttrType == 101001) { SoundPlay.Play("hit_deck_yidao", false, false); } else if (Attacker.m_Attr.AttrType == 101002) { if (lifeM is IggWall) { SoundPlay.Play("hit_wall", false, false); } else { SoundPlay.Play("hit_deck_money", false, false); } } else if (Attacker.m_Attr.AttrType == 102001) { SoundPlay.Play("hit_deck_bear", false, false); } else { SoundPlay.Play("hit_deck_rui", false, false); } } }
/// <summary> /// 撞击 左右 船板 掉落 /// </summary> /// <param name="fallTime"></param> /// <param name="isLeft">是否是左侧甲板</param> public void HitFall(float fallTime, bool isLeft, Vector3 droppos) { Transform t = m_Skin.tRoot; t.position += droppos; Vector3 pos = t.localPosition; pos.y += -10; if (isLeft) { pos.x -= 5; t.Rotate(0, 0, -90); } else { pos.x += 8; t.Rotate(0, 0, 90); } TweenPosition tp = TweenPosition.Begin(t.gameObject, fallTime, pos, false); tp.AddOnFinished(FallEnd); t.localRotation = new Quaternion(0, 0, 0, 1); SoundPlay.Play("drop_sea", false, false); }
//播放起爆点爆炸效果 public void PlayEffect(int step) { if (step == 0) { PlayStep1(); } else if (step == 1) { PlayStep2(); } else if (step == 2) { if (ProcessType == BombProcessType.End) { PlayStep3("2000271_03", 2.0f); SoundPlay.Play("bigboom", false, false); } else { PlayStep3("2000271_02", 2.0f); SoundPlay.Play("middleboom", false, false); } } }
/// <summary> /// 释放技能主逻辑 /// </summary> protected override bool ReleaseSkill(ref List <Life> RoleList, ref int nAttackIndex) { bool IsRelease = false; if (RoleList.Count > 0) { m_fAttackTimer = Time.time; IsRelease = true; m_TriggerIng = true; SetAnimator(Build_AnimatorState.Trigger30000); SoundPlay.Play("Trap/trap_prison", false, false); foreach (Life w in RoleList) { GridActionCmd action = null; if (w is Role) { action = (w as Role).CurrentAction; } SkillReleaseInfo Info = m_Skill.SkillRelease(this, w, action, m_Skill.PropSkillInfo); w.ApplyDamage(Info, m_thisT); } } return(IsRelease); }
private void LoadTrophies(int gtype, int gid, bool isSoul = false, bool isNewVersion = false, int num = 0, bool isBook = false) { NGUIUtil.SetActive(MyHead.SkillInfo, false); NGUIUtil.SetActive(MyHead.Building, false); if (isNewVersion) { if (MyHead.LblDes != null) { MyHead.LblDes.gameObject.SetActive(false); } } if (gtype == 1) //炮弹兵 { SoldierInfo Info = SoldierM.GetStartSoldierInfo(gid); CreateSoldier(Info); if (isNewVersion) { if (isSoul && num > 0) { int startLevel = SoldierM.GetSoldierStarLevel(Info.SoldierTypeID); MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(10000119), startLevel, num); MyHead.LblDes.gameObject.SetActive(true); } } else if (m_isSoulPis && m_SoulPisNum > 0) { int startLevel = SoldierM.GetSoldierStarLevel(Info.SoldierTypeID); MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(10000119), startLevel, m_SoulPisNum); } m_bNotTween = false; } else if (gtype == 3) // 陷阱/建筑物 { BuildInfo Info = buildingM.GetStartBuildInfo(gid); if (Info != null) { CreateBuilding(Info); } m_bNotTween = true; } else if (gtype == 4) //黑科技 { NGUIUtil.SetActive(MyHead.BlackScience, true); CaptionInfo info = new CaptionInfo(); GodSkillM.GetCaption(gid, ref info); CreateBlackScience(info); if (isNewVersion) { if (isBook && num > 0) { int star = GodSkillM.GetCaptionMinStarLevel(info.m_godskilltype1); MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(30000060), star, num); MyHead.LblDes.gameObject.SetActive(true); } } else if (m_isSoulPis && m_SoulPisNum > 0) { int star = GodSkillM.GetCaptionMinStarLevel(info.m_godskilltype1); MyHead.LblDes.text = string.Format(NGUIUtil.GetStringByKey(30000060), star, m_SoulPisNum); } m_bNotTween = true; } else if (gtype == 5) //设计图 { StaticShipCanvas cInfo = ShipPlanM.GetShipCanvasInfo(gid); CreateDesignPic(cInfo); m_bNotTween = true; } else if (gtype == 2) //碎片 { CreateTrophyItem(gtype, gid); } SoundPlay.Play("get_item", false, false); }
public override void Start() { base.Start(); SoundPlay.Play(m_effectSoundName, false, false); }
public override void UpdateHitByBuild() { if (m_TimeCount < m_walktime) { Vector3 topos = m_End; topos.z = m_Start.z; Vector3 pos = Vector3.Lerp(m_Start, topos, m_TimeCount / m_walktime); //m_AniSpeed = 2f; PlayAction(AnimatorState.Walk, pos, true); } else if (m_TimeCount < m_JumpTime) { Vector3 topos = m_End; topos.z = m_Start.z; Vector3 pos = Vector3.Lerp(topos, m_End, (m_TimeCount - m_walktime) / (m_JumpTime - m_walktime)); PlayAction(AnimatorState.SanNa, pos, true); if ((m_TimeCount - m_Delatime) < (m_walktime + 0.3f) && m_TimeCount > (m_walktime + 0.3f)) { Vector3 effectpos = m_Skin.tRoot.position; effectpos.y += 0.8f; //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1906031",effectpos,0.75f); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1906031", effectpos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.75f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; SoundPlay.Play("Trap/trap_sauna", false, false); } } else if (m_TimeCount < m_statusTime) { Transform t = m_Skin.tRoot; Vector3 topos = m_des; topos.z = m_End.z; t.localPosition = topos; if ((m_TimeCount - m_Delatime) < m_JumpTime) { (m_Skin as RoleSkin).HitByBuildingEffect(HitbyBuilding.HitByBuild1504, true, 0, HitEffectMode.CoverBody, null); PlayAction(AnimatorState.Stand, m_Start); } } else if (m_TimeCount < m_jumpouttime) { Vector3 frompos = m_des; frompos.z = m_End.z; Vector3 topos = frompos; topos.y += 1f; Vector3 pos = Vector3.Lerp(frompos, topos, (m_TimeCount - m_statusTime) / (m_jumpouttime - m_statusTime)); PlayAction(AnimatorState.Stand, pos, true); } else if (m_TimeCount < m_Duration) { (m_Skin as RoleSkin).HitByBuildingEffect(HitbyBuilding.HitByBuild1504, false, 0, HitEffectMode.CoverBody, null); m_Skin.tBody.localScale = new Vector3(1, 1, -1); Vector3 topos = m_des; topos.z = m_End.z; Vector3 pos = Vector3.Lerp(topos, m_des, (m_TimeCount - m_jumpouttime) / (m_Duration - m_jumpouttime)); PlayAction(AnimatorState.SanNa, pos, true); if ((m_TimeCount - m_Delatime) < (m_jumpouttime) && m_TimeCount > (m_jumpouttime)) { Vector3 effectpos = m_Skin.tRoot.position; effectpos.y += 0.8f; //m_effectgo = SkillEffects._instance.LoadEffect("effect/prefab/", "1906031",effectpos,0.75f); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1906031", effectpos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(0.75f); gae.AddAction(ndEffect); m_effectgo = gae.gameObject; } } else if (m_TimeCount >= m_Duration) { m_Skin.tBody.localScale = new Vector3(1, 1, 1); m_LifePrent.InBoat = true; } }
public override void DoEvent() { base.DoEvent(); SoundPlay.Play("broadsword_atc", false, false); }
public override void StartWithTarget(Life Parent, StartAttackFun StartAttack) { base.StartWithTarget(Parent, StartAttack); PlayAction(AnimatorState.Attack85100, m_Start); SoundPlay.Play("atc_maonv", false, false); }
public override void ActiiveStart() { Life w = m_LifePrent.m_Skill.m_SkillTarget; if (w is Role) { //Transform EffectPos = (w as Role).m_Skin.ProPerty.m_EffectPos; GameObject posgo = (w as Role).m_Skin.ProPerty.HelpPoint.GetVauleByKey(HelpPointName.EffectPos); if (posgo != null) { Vector3 pos = posgo.transform.position; pos.z = -1.5f; //SkillEffects._instance.LoadEffect("effect/prefab/", "1002051",pos,1f); GameObjectActionExcute gae1 = EffectM.LoadEffect(EffectM.sPath, "1002051", pos, BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect1 = new GameObjectActionDelayDestory(1f); gae1.AddAction(ndEffect1); } } SoundPlay.Play("skill_voice_yidao", false, false); SoundPlay.Play("skill_yidao_sstx", false, false); Life emeny = CM.GetAllLifeM(m_AttackSceneID, LifeMType.ALL); GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1051041", BattleEnvironmentM.Local2WorldPos(m_TargetPos), BattleEnvironmentM.GetLifeMBornNode(true)); GameObjectActionDelayDestory ndEffect = new GameObjectActionDelayDestory(m_action3); gae.AddAction(ndEffect); GameObject go = gae.gameObject; go.transform.parent = m_Skin.tRoot; go.transform.localPosition = Vector3.zero; //m_LifePrent.InBoat =false; MapGrid gfrom = m_LifePrent.GetMapGrid(); m_TelePortGrid = gfrom; MapGrid gstart = gfrom; //m_Dir = WalkDir.WALKRIGHT; MapGrid gto = emeny.GetTargetMapGrid(); int startunit = MapSize.GetGridStart(gto.GridPos.Layer); int endtunit = startunit + MapSize.GetLayerSize(gto.GridPos.Layer) - 1; //if (gto.GridPos.Layer > 0) MapGrid start = MapGrid.GetMG(gto.GridPos.Layer, startunit); MapGrid end = MapGrid.GetMG(gto.GridPos.Layer, endtunit); MapGrid gl = gto.GetNextAttackStation(DIR.LEFT, false); MapGrid gr = gto.GetNextAttackStation(DIR.RIGHT, false); if (gl == null && gr == null) { Debug.LogError("xxxxxxxxxxxxxxxxXXXXXXXXXXXXXX " + gto.GridPos); } if (emeny is Role) { m_TargetPos = emeny.m_thisT.localPosition; } else { m_TargetPos = gto.pos; } if (gfrom.GridPos.Unit < startunit) { gstart = start; } else if (gfrom.GridPos.Unit > endtunit) { gstart = end; } if (gto.GridPos.Layer > 0) { int upstartunit = MapSize.GetGridStart(gto.GridPos.Layer - 1); int upendtunit = upstartunit + MapSize.GetLayerSize(gto.GridPos.Layer - 1) - 1; MapGrid upstart = MapGrid.GetMG(gto.GridPos.Layer - 1, upstartunit); MapGrid upend = MapGrid.GetMG(gto.GridPos.Layer - 1, upendtunit); if (gfrom.GridPos.Unit < upstartunit) { gstart = upstart; } else if (gfrom.GridPos.Unit > upendtunit) { gstart = upend; } } m_gs = (m_LifePrent as Role).CurrentGS; if (m_gs == GridSpace.Space_UP) { m_LifePrent.m_thisT.localScale = new Vector3(m_LifePrent.m_thisT.localScale.x, -m_LifePrent.m_thisT.localScale.y, m_LifePrent.m_thisT.localScale.z); } if (gr != null && gstart.GridPos.Unit > gr.GridPos.Unit) { m_Dir = WalkDir.WALKLEFT; m_PreTelePortGrid = gr; if (gl != null) { /*MapGrid temp = gl.GetNextAttackStation(DIR.LEFT,false); * if ( temp!= null) * gl = temp;*/ //w.Teleport(gl); m_TelePortGrid = gl; m_End = gl.pos; //m_Dir = WalkDir.WALKLEFT; } else { m_TelePortGrid = gr; //w.Teleport(gr); m_End = gr.pos; } MapGrid oldgrid = null; if (gstart.GridPos.Unit - gr.GridPos.Unit <= 3) { oldgrid = MapGrid.GetMG(gr.GridPos.Layer, gstart.GridPos.Unit); if (m_gs == GridSpace.Space_DOWN) { lpos.Add(gfrom.pos); Vector3 upos = gr.Uppos; upos.x += (oldgrid.Uppos.x - gr.Uppos.x) / 2; lpos.Add(upos); lpos.Add(gr.pos); } else { lpos.Add(gfrom.Uppos); lpos.Add(gr.pos); } } else { oldgrid = MapGrid.GetMG(gr.GridPos.Layer, gstart.GridPos.Unit); if (m_gs == GridSpace.Space_DOWN) { lpos.Add(gfrom.pos); Vector3 upos = gr.Uppos; upos.x += (oldgrid.Uppos.x - gr.Uppos.x) * 3 / 4; lpos.Add(upos); lpos.Add(gr.pos + new Vector3((oldgrid.pos.x - gr.pos.x) / 2, 0, 0)); lpos.Add(gr.Uppos + new Vector3((oldgrid.Uppos.x - gr.Uppos.x) / 4, 0, 0)); lpos.Add(gr.pos); } else { lpos.Add(gfrom.Uppos); lpos.Add(gr.pos); } } } else if (gl != null && gstart.GridPos.Unit < gl.GridPos.Unit) { m_Dir = WalkDir.WALKRIGHT; m_PreTelePortGrid = gl; if (gr != null) { /*MapGrid temp = gr.GetNextAttackStation(DIR.RIGHT,false); * if ( temp!= null) * gr = temp;*/ //w.Teleport(gr); m_TelePortGrid = gr; m_End = gr.pos; } else { //w.Teleport(gl); m_TelePortGrid = gl; m_End = gl.pos; } MapGrid oldgrid = null; if (gl.GridPos.Unit - gstart.GridPos.Unit <= 3) { oldgrid = MapGrid.GetMG(gl.GridPos.Layer, gstart.GridPos.Unit); if (m_gs == GridSpace.Space_DOWN) { lpos.Add(gfrom.pos); Vector3 upos = gl.Uppos; upos.x += (oldgrid.Uppos.x - gl.Uppos.x) / 2; lpos.Add(upos); lpos.Add(gl.pos); } else { lpos.Add(gfrom.Uppos); lpos.Add(gl.pos); } } else { oldgrid = MapGrid.GetMG(gl.GridPos.Layer, gstart.GridPos.Unit); if (m_gs == GridSpace.Space_DOWN) { lpos.Add(gfrom.pos); Vector3 upos = oldgrid.Uppos; upos.x += (gl.Uppos.x - oldgrid.Uppos.x) / 4; lpos.Add(upos); lpos.Add(oldgrid.pos + new Vector3((gl.pos.x - oldgrid.pos.x) / 2, 0, 0)); lpos.Add(oldgrid.Uppos + new Vector3((gl.Uppos.x - oldgrid.pos.x) * 3 / 4, 0, 0)); lpos.Add(gl.pos); } else { lpos.Add(gfrom.Uppos); lpos.Add(gl.pos); } } } else { if (gl != null && gfrom.GridPos.Unit < gto.GridPos.Unit) { m_Dir = WalkDir.WALKRIGHT; m_Start = gl.pos; m_End = gl.pos; m_PreTelePortGrid = gl; if (gr != null) { lpos.Add(gfrom.pos); Vector3 upos = gl.Uppos; upos.x += (gr.Uppos.x - gl.Uppos.x) / 2; lpos.Add(upos); lpos.Add(gr.pos); lpos.Add(upos); lpos.Add(gl.pos); //w.Teleport(gr); m_TelePortGrid = gr; m_End = gr.pos; } else { m_TelePortGrid = gl; lpos.Add(gfrom.pos); Vector3 upos = gl.Uppos; lpos.Add(upos); lpos.Add(gl.pos); lpos.Add(upos); lpos.Add(gl.pos); } } else if (gr != null && gfrom.GridPos.Unit > gto.GridPos.Unit) { m_PreTelePortGrid = gr; m_Dir = WalkDir.WALKLEFT; m_Start = gr.pos; m_End = gr.pos; if (gl != null) { lpos.Add(gfrom.pos); Vector3 upos = gl.Uppos; upos.x += (gr.Uppos.x - gl.Uppos.x) / 2; lpos.Add(upos); lpos.Add(gl.pos); lpos.Add(upos); lpos.Add(gr.pos); //w.Teleport(gl); m_TelePortGrid = gl; m_End = gl.pos; } else { m_TelePortGrid = gr; lpos.Add(gfrom.pos); Vector3 upos = gr.Uppos; lpos.Add(upos); lpos.Add(gr.pos); lpos.Add(upos); lpos.Add(gr.pos); } } else { m_PreTelePortGrid = gto; m_Start = gto.pos; m_End = gto.pos; //Debug.Log("左右都没有攻击位" + gl.GridPos + "," + gr.GridPos + "," +gfrom.GridPos + "," + gto.GridPos.Unit); } } //PlayAction(AnimatorState.Skill01,m_Start,true); #if UNITY_EDITOR_LOG string str = "lujin:"; for (int i = 0; i < lpos.Count; i++) { str += lpos[i] + ", "; } //Debug.Log(str + ", mend " +m_End); #endif if (lpos.Count > 0) { m_Start = lpos[lpos.Count - 1]; m_oncejumptime = m_JumpTime / (lpos.Count - 1); m_AniSpeed = 0.8f / m_oncejumptime; m_gs = (m_LifePrent as Role).CurrentGS; m_JumpCount = 0; } #if UNITY_EDITOR_LOG FileLog.write(m_LifePrent.SceneID, "能量燃烧 " + m_Start + "," + m_End + "," + m_TelePortGrid.GridPos + "," + m_Dir + "," + gfrom.GridPos + "," + gto.GridPos); #endif }