void Update() { if (false == m_WholeChild.activeInHierarchy) { if (Time.time - m_ShowUIDelayTimer >= m_ShowUIDelay) { m_WholeChild.SetActive(true); bool bWin = false; if (Singleton <ObjManager> .Instance.MainPlayer != null) { if (!Singleton <ObjManager> .Instance.MainPlayer.IsDie()) { StoryCopySceneScoreInfo info = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetLastScore(); bWin = info.m_bResult ? true : false; } } InitWinOrFail(bWin); SetPlay(0); m_ShowUIDelayTimer = 0; Init(bWin); } } if (m_StarEffectShow) { for (; m_StarIndex < m_StarEffect.Length && m_StarIndex < m_ConditionLight.Length && m_StarIndex < m_StarGot.Length; m_StarIndex++) { if (m_StarGot[m_StarIndex]) { m_StarEffect[m_StarIndex].SetActive(true); m_ConditionLight[m_StarIndex].SetActive(true); SetPlay(m_StarIndex + 1); GameManager.gameManager.SoundManager.PlaySoundEffect(251); m_StarMax += 1; } } if (m_StarIndex >= m_StarEffect.Length) { m_StarEffectShow = false; m_StarIndex = 0; } } //add 打星音效 chenzhong 2016/4/7 if (Time.time - m_StarTimer >= m_StarShowTime && m_StarIndex >= 0 && m_StarMax > 0) { m_StarTimer = Time.time; GameManager.gameManager.SoundManager.PlaySoundEffect(251); m_StarMax--; } }
void Init(bool bWin) { clear(); //get data from playerdata int nStoryID = GameManager.gameManager.ActiveScene.GetStoryCopySceneID(); m_StarTimer = Time.time; if (bWin) { m_StarEffectShow = true; m_FailObj.SetActive(true); m_Title.text = StrDictionary.GetClientDictionaryString("#{3827}"); } StoryCopySceneScoreInfo info = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetLastScore(); m_StarGot[0] = info.m_bFirstStarGet; m_StarGot[1] = info.m_bSecondStarGet; m_StarGot[2] = info.m_bThirdStarGet; //update info Tab_StoryCopyScene tBook = TableManager.GetStoryCopySceneByID(nStoryID, 0); if (tBook != null) { //condition/////////////////////////////////////////////////////// InitCondition(tBook); //Bonus////////////////////////////////////////////////////////////// InitStarAward(tBook, bWin); InitLeft(tBook, bWin); } }