Exemple #1
0
 public override void Validate()
 {
     for (int i = 0; i < this._elementList.Count; i++)
     {
         MultiGainWgt.MultiGainListItem multiGainListItem = this._elementList[i];
         multiGainListItem.Validate();
     }
 }
 public override void Validate()
 {
     for (int i = 0; i < this._elementList.get_Count(); i++)
     {
         MultiGainWgt.MultiGainListItem multiGainListItem = this._elementList.get_Item(i);
         multiGainListItem.Validate();
     }
 }
Exemple #3
0
 private void OnClickGoto(CUIEvent uiEvent)
 {
     for (int i = 0; i < this._elementList.Count; i++)
     {
         MultiGainWgt.MultiGainListItem multiGainListItem = this._elementList[i];
         if (multiGainListItem.gotoBtn == uiEvent.m_srcWidget)
         {
             base.view.form.Close();
             multiGainListItem.actvPhase.AchieveJump();
             break;
         }
     }
 }
Exemple #4
0
        public MultiGainWgt(GameObject node, ActivityView view) : base(node, view)
        {
            this._elementTmpl = Utility.FindChild(node, "Template");
            float height = this._elementTmpl.GetComponent <RectTransform>().rect.height;
            ListView <ActivityPhase> phaseList = view.activity.PhaseList;

            this._elementList = new ListView <MultiGainWgt.MultiGainListItem>();
            for (int i = 0; i < phaseList.Count; i++)
            {
                GameObject gameObject;
                if (i > 0)
                {
                    gameObject = (GameObject)Object.Instantiate(this._elementTmpl);
                    gameObject.transform.SetParent(this._elementTmpl.transform.parent);
                    gameObject.transform.localPosition = this._elementList[i - 1].root.transform.localPosition + new Vector3(0f, -(height + 5f), 0f);
                    gameObject.transform.localScale    = Vector3.one;
                    gameObject.transform.localRotation = Quaternion.identity;
                }
                else
                {
                    this._elementTmpl.SetActive(true);
                    gameObject = this._elementTmpl;
                }
                MultiGainWgt.MultiGainListItem item = new MultiGainWgt.MultiGainListItem(gameObject, (MultiGainPhase)phaseList[i]);
                this._elementList.Add(item);
            }
            if (this._elementList.Count == 0)
            {
                this._elementTmpl.SetActive(false);
            }
            node.GetComponent <RectTransform>().sizeDelta = new Vector2(node.GetComponent <RectTransform>().sizeDelta.x, (this._elementList.Count > 0) ? (height * (float)this._elementList.Count + (float)(this._elementList.Count - 1) * 5f) : 0f);
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Activity_ClickGoto, new CUIEventManager.OnUIEventHandler(this.OnClickGoto));

            view.activity.OnTimeStateChange += new Activity.ActivityEvent(this.OnStateChange);
            this.Validate();
        }