private void OnNextReasonItem(bool flag) { if (flag) { m_currentIndex++; if (m_currentIndex >= m_confReason.nodes.Length) { CSReasoningRewardReq req = new CSReasoningRewardReq(); req.ReasoningId = m_confReason.id; GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req); ReasoningUILogic.HideReasonUI(); return; } this.m_currentProgressLab.Text = (m_currentIndex + 1) + "/" + m_confReason.nodes.Length; for (int i = 0; i < m_confReason.nodes.Length; i++) { ReasoningIcon reasonIcon = this.m_container.GetChild <ReasoningIcon>(i); reasonIcon.OnNextReasonItem(); } TimeModule.Instance.SetTimeout(() => { this.reasonContentCom.SetData(ConfNode.Get(m_confReason.nodes[m_currentIndex])); this.reasonContentCom.PlayTween(true); }, 0.5f); } else { ReasoningIcon reasonIcon = this.m_container.GetChild <ReasoningIcon>(m_currentIndex); reasonIcon.PlayErrorTips(); } }
public void InitData(ConfReasoning confReason) { this.m_confReason = confReason; int nodesLength = confReason.nodes.Length; m_centerPos = this.m_container.ContainerTemplate.GetComponent <RectTransform>().anchoredPosition; this.m_container.EnsureSize <ReasoningIcon>(nodesLength); for (int i = 0; i < nodesLength; i++) { if (i == 0) { this.reasonContentCom.SetData(ConfNode.Get(confReason.nodes[i])); } ReasoningIcon reasonIcon = this.m_container.GetChild <ReasoningIcon>(i); reasonIcon.SetData(ConfNode.Get(confReason.nodes[i]), i, i == nodesLength - 1); reasonIcon.Visible = true; } }