示例#1
0
        public void ShowDiamond(CatchedData cd, Fish fish)
        {
            GoldEffectData ged = new GoldEffectData();

            ged.GameObj = Initobj(m_DiamondObj);


            ged.GameObj.transform.position = UIManager.Instance.WordToScenePoint(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.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, 0.6f);
            ged.m_DelayTime = 2;
            ged.GoldNum     = 1;
            ged.PlayTween(true);
            ged.m_Tween.m_Pos.enabled = false;
            ged.ScaleGoldTR(1.0f, fish.IsBossFish() ? 1.0f : 0.6f);

            Vector3 vecGoldEndpos = Vector3.one;

            vecGoldEndpos = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat);
            DOTween.To(() => ged.GameObj.transform.position, x => ged.GameObj.transform.position = x, vecGoldEndpos, 2);
            ged.m_vecpathend = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat);
            m_diamondList.Add(ged);
        }
示例#2
0
 void UpdateRoleGold(GoldEffectData ged)
 {
     if (ged != null)
     {
         SceneRuntime.PlayerMgr.UpdatePlayerGold(ged.ClientSeat, (int)ged.GoldNum);
         if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() != 0)
         {
             //GlobalHallUIMgr.Instance.UpdateMyMatchScoreInfo();
         }
     }
     //if (ged.ClientSeat == SceneRuntime.PlayerMgr.MyClientSeat)
     //{
     //    uint gold = PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() + ged.GoldNum;
     //    PlayerRole.Instance.RoleInfo.RoleMe.SetGlobel(gold);
     //}
     //else
     //{
     //    ScenePlayer sp = SceneRuntime.PlayerMgr.GetPlayer(ged.ClientSeat);
     //    uint gold = PlayerRole.Instance.TableManager.GetTableRole(sp.Player.playerData.ID).GetGlobel() + ged.GoldNum;
     //    PlayerRole.Instance.TableManager.GetTableRole(sp.Player.playerData.ID).SetGlobel(gold);
     //}
 }
示例#3
0
        //单个金币
        public void ShowUnLockRateReward(Vector3 pos)
        {
            for (int i = 0; i < 3; i++)
            {
                GoldEffectData ged = new GoldEffectData();
                ged.GameObj = Initobj(m_GoldObj);
                ged.GameObj.transform.position = pos + ((new Vector3(Utility.RandFloat(), Utility.RandFloat(), 0)) * 0.15f);

                /*ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponent<TweenPosition>();
                 * ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponent<TweenScale>();*/
                ged.m_Tween.m_Pos   = ged.GameObj.transform.GetComponents <DOTweenAnimation>()[0];
                ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponents <DOTweenAnimation>()[1];
                ged.ScaleGoldTR(0.6f, 0.6f);
                ged.m_DelayTime = 0;
                ged.GoldNum     = 1;
                ged.PlayTween(true);
                ged.m_vecpathend = SceneRuntime.GetLauncherGoldIconPos(SceneRuntime.SceneModel.PlayerMgr.MySelf.ClientSeat);
                m_UnlockRateList.Add(ged);
            }
            //  if (SceneRuntime.PlayerMgr.GetPlayer(ged.catchedData.ClientSeat) == SceneRuntime.PlayerMgr.MySelf)
            //   GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_GoldJump);
        }
示例#4
0
        public void Update(float delta)
        {
            for (byte i = 0; i < m_CatchedList.Count;)
            {
                GoldEffectData ged = m_CatchedList[i];
                if (ged.Update(delta) == false)
                {
                    if (++ged.catchedData.GoldFinished == ged.catchedData.FishList.Count)
                    {
                    }// ShowGoldNumLabel(ged);
                    ShowGoldEndLargen(ged.catchedData.ClientSeat);      //金币结束动画后放大效果
                    UpdateRoleGold(ged);

                    /*if (SceneRuntime.PlayerMgr.GetPlayer(ged.catchedData.ClientSeat) == SceneRuntime.PlayerMgr.MySelf)
                     *  GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_UserGetGold);*/

                    ged.DsetorySelf();
                    Utility.ListRemoveAt(m_CatchedList, i);
                }
                else
                {
                    ++i;
                }
            }

            for (int i = 0; i < m_UnlockRateList.Count;)
            {
                GoldEffectData ged = m_UnlockRateList[i];
                if (ged.Update(delta) == false)
                {
                    ged.DsetorySelf();
                    Utility.ListRemoveAt(m_UnlockRateList, i);
                    //GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_Niuniu17);
                }
                else
                {
                    i++;
                }
            }
            for (int i = 0; i < m_diamondList.Count;)
            {
                GoldEffectData ged = m_diamondList[i];
                if (ged.Update(delta) == false)
                {
                    ged.DsetorySelf();
                    Utility.ListRemoveAt(m_diamondList, i);
                }
                else
                {
                    i++;
                }
            }

            for (byte i = 0; i < m_CatchedLabelList.Count;)
            {
                GoldEffectLabelData data = m_CatchedLabelList[i];
                if (data.Update(delta) == false)
                {
                    data.DestorySelf();
                    Utility.ListRemoveAt(m_CatchedLabelList, i);
                }
                else
                {
                    ++i;
                }
            }
            for (byte j = 0; j < m_GetGoldList.Count;)
            {
                GoldEffectLabelData getGold = m_GetGoldList[j];
                if (getGold.Update(delta) == false)
                {
                    getGold.DestorySelf();
                    Utility.ListRemoveAt(m_GetGoldList, j);
                }
                else
                {
                    ++j;
                }
            }
            if (m_EndLargenGold.m_GameObj != null)
            {
                if (m_EndLargenGold.Update(delta) == false)
                {
                    m_EndLargenGold.DestorySelf();
                }
            }
        }
示例#5
0
        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);
        }