public void ConsumeGold(byte clientSeat, int gold, ScenePlayer sp) { if (m_PlayerList[clientSeat] == null) { Debug.Log("client Player is null."); return; } if (!MatchJudge.IsMatch() && clientSeat == m_MyClientSeat) { //GlobalHallUIMgr.Instance.GameShare.AddGlod(-gold); } PlayerRole.Instance.OnAddUserGlobelByCatchedData(clientSeat, -gold); m_PlayerList[clientSeat].Launcher.UpdateUserGold(m_PlayerList[clientSeat].ClientSeat); }
void ShowGoldEndLargen(byte clientSeat) { if (MatchJudge.IsMatch()) { return; } Vector3 pos = SceneRuntime.GetLauncherGoldIconPos(clientSeat); if (m_EndLargenGold.m_GameObj == null && m_EndLargenGold.m_LifeTime <= 0.03f) { m_EndLargenGold.m_GameObj = Initobj(m_LargenGoldObj); m_EndLargenGold.Init(); m_EndLargenGold.m_TrnasGold.position = pos; } }
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 = UIManager.Instance.WordToScenePoint(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() * 100, Utility.RandFloat(), 0)) * (fish.IsBossFish() ? 0.45f : 0.15f); //ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponents<DOTweenAnimation>()[0]; //ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponents<DOTweenAnimation>()[1]; 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; DOTween.To(() => ged.GameObj.transform.position, r => ged.GameObj.transform.position = r, vecGoldEndpos, 0.5f).SetDelay(1 + i * 0.1f).OnComplete(() => { ged.DsetorySelf(); } ); } ShowGoldNumLabel(fishGold, FishPos, fish); }