void InitStarAward(Tab_StoryCopyScene tBook, bool bWin) { bool[] bPreStarGot = new bool[3]; StoryCopySceneLevelInfo levelInfo = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetLevelByLevelID(tBook.Id); bPreStarGot[0] = levelInfo.IsPreGetStar1(); bPreStarGot[1] = levelInfo.IsPreGetStar2(); bPreStarGot[2] = levelInfo.IsPreGetStar3(); int nAwardCount = 0; if (!bWin) { return; } for (int nIndex = 0; nIndex < tBook.getStarRewardCount(); ++nIndex) { int nAward = tBook.GetStarRewardbyIndex(nIndex); Tab_StoryCopySceneAward tSCS = TableManager.GetStoryCopySceneAwardByID(nAward, 0); if (tSCS != null) { for (int nAwardIndex = 0; nAwardIndex < tSCS.getItemIDCount() && nAwardIndex < tSCS.getItemNumCount(); ++nAwardIndex) { int nID = tSCS.GetItemIDbyIndex(nAwardIndex); int nNum = tSCS.GetItemNumbyIndex(nAwardIndex); if (nID > 0 && nNum > 0) { if (nAwardCount >= 0 && nAwardCount < m_BonusItem.Length && nIndex < m_StarGot.Length && m_StarGot[nIndex]) { m_BonusItem[nIndex].gameObject.SetActive(true); m_BonusItem[nIndex].SetShowItem(nID, nNum, m_StarGot[nIndex], bPreStarGot[nIndex]); nAwardCount++; break; } } } } } }
public void UpdateStarInfo() { if (null != GameManager.gameManager.PlayerDataPool.JuQingCopySceneData) { StoryCopySceneLevelInfo levelInfo = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetLevelByLevelID(m_nStoryCopySceneID); if (levelInfo.IsGetStar1()) { m_StarActive[0].enabled = true; m_Got[0].SetActive(true); } if (levelInfo.IsGetStar2()) { m_StarActive[1].enabled = true; m_Got[1].SetActive(true); } if (levelInfo.IsGetStar3()) { m_StarActive[2].enabled = true; m_Got[2].SetActive(true); } } }