void OnOpenCheck() { WndManager.Instance.Push(m_LotteryTrans); uint LotteryScore = PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryScore(); if (LotteryScore > FishConfig.Instance.m_LotteryConfig.LotteryMap[6].NeedUseScore) { LotteryScore = FishConfig.Instance.m_LotteryConfig.LotteryMap[6].NeedUseScore; } uint FishSum = PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum(); uint Maxfish = FishConfig.Instance.m_LotteryConfig.MaxLotteryFishSum; int lotteryLevel = PlayerRole.Instance.RoleLottery.GetLotteryID(); if (FishSum >= Maxfish) { //FishSum = Maxfish; FishSum = LotteryScore; m_Sprite[1].SetActive(true); m_Sprite[0].SetActive(false); if (lotteryLevel == 0) { Maxfish = FishConfig.Instance.m_LotteryConfig.LotteryMap[1].NeedUseScore; } else if (lotteryLevel == 6) { Maxfish = FishConfig.Instance.m_LotteryConfig.LotteryMap[(byte)lotteryLevel].NeedUseScore; } else { Maxfish = FishConfig.Instance.m_LotteryConfig.LotteryMap[(byte)(lotteryLevel + 1)].NeedUseScore; } } else { m_Sprite[1].SetActive(false); m_Sprite[0].SetActive(true); } if (lotteryLevel > 0) { m_BtnObj.transform.GetChild(1).gameObject.SetActive(true); m_BtnObj.transform.GetChild(0).gameObject.SetActive(false); OnClickChangeLevel(m_LotteryLevelBtns[lotteryLevel - 1]); } else { m_BtnObj.transform.GetChild(1).gameObject.SetActive(false); m_BtnObj.transform.GetChild(0).gameObject.SetActive(true); OnClickChangeLevel(m_LotteryLevelBtns[0]); } CurrentAward.text = LotteryScore.ToString(); CurrentKill.text = FishSum.ToString(); MaxKill.text = Maxfish.ToString(); ProgressBar_Light.fillAmount = ((float)FishSum) / Maxfish; level = (LotteryLevel)lotteryLevel; m_LotteryWndObj.SetActive(true); }
void OnClickChangeLevel(GameObject go) { ClearGrid(); for (byte i = 0; i < m_LotteryLevelBtns.Length; ++i) { if (go == m_LotteryLevelBtns[i]) { m_LotteryLevelBtnsCheck[i].SetActive(true); m_LotteryLevelBtns[i].SetActive(false); chooseLevel = (LotteryLevel)(i + 1); SetScrollViewDate(); } else { m_LotteryLevelBtnsCheck[i].SetActive(false); m_LotteryLevelBtns[i].SetActive(true); } } }