public void PlayXPSkillMuzzleEft(Transform parent, byte type, Vector3 pos, float life) { GameObject go = GameObject.Instantiate(m_SkillMuzzleObj[type]) as GameObject; go.transform.SetParent(parent, false); go.transform.position = SceneRuntime.WorldToNGUI(pos); m_XPSkillMuzzleEft = new GlobalEffectData(go, 0, life); GlobalEffectMgr.Instance.AddEffect(m_XPSkillMuzzleEft); GlobalEffectMgr.SetEffectOnUI(go); //m_EffectList.Add(go); }
public void ShowBossFishSpecailEft(CatchedData cd, Fish fish) { GameObject go = GameObject.Instantiate(m_BossFishSpecailEftObj) as GameObject; go.transform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false); go.transform.position = SceneRuntime.WorldToNGUI(fish.Position); GlobalEffectData bossFishEft = new GlobalEffectData(go, 0, 5); GlobalEffectMgr.Instance.AddEffect(bossFishEft); // GlobalEffectMgr.SetEffectOnUI(go); SceneObjMgr.Instance.PlayBack(BackAnimType.BACK_ANIM_BOSS); }
//鱼被捕获调用接口,弹出金币 public void FishCatched(Fish fish, CatchedData cd) { if (fish.IsBossFish()) { GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.catch_bossfish); } m_GoldEffect.ShowGoldEffect(cd, fish); KonnoTool.ShowBossCatched(SceneRuntime.WorldToNGUI(fish.Position), cd.GoldNum); if (fish.IsBossFish()) { //BossFish彩蛋特效 m_GoldEffect.ShowBossFishSpecailEft(cd, fish); } //卡片掉落 ushort nReward = fish.GetDropReward(); if (nReward != 0) { tagRewardOnce pReward; if (!FishConfig.Instance.m_RewardConfig.RewardMap.TryGetValue(nReward, out pReward)) { return; } for (int i = 0; i < pReward.RewardItemVec.Count; i++) { tagItemConfig itemConfig; uint uItemid = pReward.RewardItemVec[i].ItemID; if (!FishConfig.Instance.m_ItemInfo.m_ItemMap.TryGetValue(uItemid, out itemConfig)) { continue; } if (itemConfig.ItemTypeID == EItemType.IT_Currey)//钻石特殊处理 { m_GoldEffect.ShowDiamond(cd, fish); } else//其他卡片 { if (SceneRuntime.SceneLogic.PlayerMgr.GetPlayer(cd.ClientSeat) == null) { continue; } Vector2 vecPos = SceneRuntime.SceneLogic.PlayerMgr.GetPlayer(cd.ClientSeat).Launcher.LauncherPos; SceneRuntime.SceneLogic.LogicUI.MoveDropCard(SceneRuntime.WorldToNGUI(fish.Position), new Vector3(vecPos.x, vecPos.y, 0), (ushort)uItemid); } } } }
public void ShowDiamond(CatchedData cd, Fish fish) { GoldEffectData ged = new GoldEffectData(); ged.GameObj = Initobj(m_DiamondObj); ged.GameObj.transform.position = SceneRuntime.WorldToNGUI(fish.Position) + (new Vector3(Utility.RandFloat(), Utility.RandFloat(), 0) * 0.45f); ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponent <TweenPosition>(); ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponent <TweenScale>(); ged.ScaleGoldTR(1.0f, 0.6f); ged.m_DelayTime = 2; ged.GoldNum = 1; ged.PlayTween(true); ged.m_vecpathend = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat); m_diamondList.Add(ged); }
public void MoveCard(GameObject goCard, Vector3 vecEnd) { ushort uId = System.Convert.ToUInt16(goCard.transform.GetChild(0).GetComponent <UISprite>().spriteName); // Vector3 vecEnd = Vector3.zero; // int nIndex = SceneRuntime.SceneLogic.LogicUI.GetSkillBar.BarItemIndex(uId); // if (nIndex != -1) { // vecEnd = SceneRuntime.SceneLogic.LogicUI.GetSkillBar.ItemPos((byte)nIndex); } Vector3 vStart = SceneRuntime.WorldToNGUI(goCard.transform.position); goCard.layer = 8; // goCard.transform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false); goCard.transform.localScale = Vector3.one; DropCardItem pCard = new DropCardItem(); m_fishcards.Add(pCard); pCard.Init(goCard, vStart, vecEnd, uId); }
public void ShowGoldEffect(CatchedData cd, Fish fish) { if (MatchJudge.IsMatch() && cd.ClientSeat != SceneRuntime.MyClientSeat)//比赛只显示自己的效果 { return; } Vector3 vecGoldEndpos = Vector3.one; if (MatchJudge.IsMatch()) { if (cd.ClientSeat == SceneRuntime.MyClientSeat) { vecGoldEndpos = GlobalHallUIMgr.Instance.MatchScorePos(); } else { vecGoldEndpos = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat); } } else//比赛 { vecGoldEndpos = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat); } const int perGoldNum = 30; //这里的金币用的还是鱼的类型 Vector3 FishPos = SceneRuntime.WorldToNGUI(fish.Position); //鱼的价值 uint fishOrgGold = (uint)FishSetting.FishDataList[fish.FishType].Gold; uint fishGold = 0; if (cd.CatchType == (byte)CatchedType.CATCHED_SKILL) { fishGold = fishOrgGold * SkillSetting.SkillDataList[cd.SubType].multiple; } else { fishGold = fishOrgGold * BulletSetting.BulletRate[cd.RateIndex]; } if (!MatchJudge.IsMatch() && cd.ClientSeat == SceneRuntime.MyClientSeat) { GlobalHallUIMgr.Instance.GameShare.AddGlod((int)fishGold); } uint goldNum = fishOrgGold / perGoldNum; uint perNum = 0; uint lastNum = 0; if (goldNum == 0) { goldNum = 1; lastNum = fishGold; } else { perNum = fishGold / goldNum; lastNum = perNum + (fishGold - perNum * goldNum); } uint num = 0; for (byte i = 0; i < goldNum; ++i) { GoldEffectData ged = new GoldEffectData(); ged.catchedData = cd; if (MatchJudge.IsMatch()) { ged.GameObj = Initobj(m_ScoreObj); } else { ged.GameObj = Initobj(m_GoldObj); } ged.GameObj.transform.position = FishPos + (new Vector3(Utility.RandFloat(), Utility.RandFloat(), 0)) * (fish.IsBossFish()?0.45f:0.15f); ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponent <TweenPosition>(); ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponent <TweenScale>(); ged.ScaleGoldTR(1.0f, fish.IsBossFish()?1.0f:0.6f); if (i > 0 && !fish.IsBossFish()) { ged.m_DelayTime += i * 0.1f; } if (fish.IsBossFish()) { ged.m_DelayTime = 1.5f; } if (i == goldNum - 1) { ged.GoldNum = lastNum; } else { ged.GoldNum = perNum; } num += ged.GoldNum; ged.ClientSeat = cd.ClientSeat; ged.PlayTween(true); ged.m_vecpathend = vecGoldEndpos; if (SceneRuntime.PlayerMgr.GetPlayer(ged.catchedData.ClientSeat) == SceneRuntime.PlayerMgr.MySelf) { GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_GoldJump); } m_CatchedList.Add(ged); } ShowGoldNumLabel(fishGold, FishPos, fish); }
public void OnActiveBox() { SceneRuntime.SceneLogic.ChestMgr.MoveBox(SceneRuntime.WorldToNGUI(m_BoxModel.transform.position)); }