public void SetData(ConfNode confNode) { this.m_confNode = confNode; this.m_descLab.Text = LocalizeModule.Instance.GetString(confNode.descs); this.m_itemDescLab.Text = confNode.cluedescs[0]; int nodeCount = confNode.clueicons.Length; this.m_container.EnsureSize <ReasonContentToggle>(nodeCount); for (int i = 0; i < nodeCount; i++) { ReasonContentToggle reasonTog = this.m_container.GetChild <ReasonContentToggle>(i); reasonTog.SetData(confNode.clueicons[i], i, OnToggle); reasonTog.Visible = true; } }
private void OnOk(GameObject obj) { this.m_okBtn.Enable = false; PlayTween(false); if (this.m_currentIndex + 1 == this.m_confNode.answer) { this.m_feedBackLab.Text = LocalizeModule.Instance.GetString(this.m_confNode.feedback); ReasonContentToggle currentTog = this.m_container.GetChild <ReasonContentToggle>(this.m_currentIndex); Vector3 startPos = currentTog.IconPosition; Vector3 endPos = GameEvents.UIEvents.UI_Reason_Event.OnGetReasonItemPosition.SafeInvoke(); Vector3[] pathPoint = new Vector3[3]; pathPoint[0] = startPos; pathPoint[1] = (startPos + endPos) / 2f + Vector3.up * 80f; pathPoint[2] = endPos; string currentIconName = this.m_confNode.clueicons[m_currentIndex]; this.m_flyIconImg.Position = startPos; this.m_flyIconImg.Sprite = currentIconName; this.m_flyIconImg.Visible = true; currentTog.EnableIcon = false; m_flyTween = this.m_flyIconImg.Widget.DOPath(pathPoint, 1.5f, PathType.CatmullRom, PathMode.TopDown2D).SetEase(Ease.OutSine).OnComplete(() => { if (CachedVisible) { this.m_flyIconImg.Visible = false; GameEvents.UIEvents.UI_Reason_Event.OnReasonIconVisible.SafeInvoke(currentIconName, true); } }); this.m_flyIconImg.Widget.DOScale(0.8f, 1.5f).SetEase(Ease.OutSine); TimeModule.Instance.SetTimeout(PlayOKFeedBack, 2.5f); } else { this.m_feedBackLab.Text = LocalizeModule.Instance.GetString("reasoning_feedback_fail "); GameEvents.UIEvents.UI_Reason_Event.OnCheckReasonItem.SafeInvoke(false); TimeModule.Instance.SetTimeout(PlayErrorFeedBack, 2f); } this.m_feedBackLab.Visible = true; }