/// <summary> /// 初始化容器 /// </summary> /// <param name="tapIndex">Tap index.</param> public void initContent(int tapIndex) { resetContentsActive(); GameObject content = getContent(tapIndex); switch (tapIndex) { case TAP_RINK_CONTENT: RankingForActiveContent csp = content.GetComponent <RankingForActiveContent> (); csp.init(this, openType); int minIntegral = 0; RankAward rankAward = LucklyActivityAwardConfigManager.Instance.getFirstSource(openType); if (rankAward != null) { minIntegral = rankAward.needSource; } csp.rankTextLabel.text = LanguageConfigManager.Instance.getLanguage("luckinfo", minIntegral.ToString()); if (useType == 3 || useType == 4) { csp.rankTextLabel.text = descInfo.Replace("%1", minIntegral.ToString()); } break; case TAP_SOURCE_CONTENT: SourceForActiveContent cms = content.GetComponent <SourceForActiveContent> (); cms.init(this, openType, mySource, useType); break; } }
/** 更新节点容器 */ public void UpdateContent() { GameObject content = getContent(currentTapIndex); if (currentTapIndex == TAP_RINK_CONTENT) { RankingForActiveContent csp = content.GetComponent <RankingForActiveContent>(); csp.updateUI(); } else if (currentTapIndex == TAP_SOURCE_CONTENT) { SourceForActiveContent cms = content.GetComponent <SourceForActiveContent> (); cms.updateUI(); } }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "close") { finishWindow(); } else { GameObject content = getContent(currentTapIndex); if (currentTapIndex == TAP_RINK_CONTENT) { RankingForActiveContent sshc = content.GetComponent <RankingForActiveContent> (); sshc.buttonEventBase(gameObj); } else if (currentTapIndex == TAP_SOURCE_CONTENT) { SourceForActiveContent ssec = content.GetComponent <SourceForActiveContent> (); ssec.buttonEventBase(gameObj); } } }