Beispiel #1
0
 public override void EnterTask()
 {
     data = GameData <DataGuideShowTipContinueInfo> .dataMap[this.nextShowId];
     if (data != null)
     {
         if (this.tipButton == null)
         {
             WWWResourceManager.Instance.Load(data.TipBtnPath, (assets) =>
             {
                 if (assets != null)
                 {
                     tipButton = assets.Instantiate();
                     tipButton.transform.SetParent(this.mRoot.transform);
                     tipButton.transform.localPosition = data.TipBtnPos;
                     tipButton.transform.localScale    = Vector3.one;
                     tip_Label      = tipButton.transform.Find("lb_tip").GetComponent <Text>();
                     tip_Label.text = data.TipContent;
                     this.tipButton.GetComponent <Button>().onClick.AddListener(() =>
                     {
                         if (data.NextId != -1)
                         {
                             this.nextShowId = data.NextId;
                             this.FinishedChild();
                             this.EnterTask();
                         }
                         else
                         {
                             this.FinishedChild();
                             this.FinishTask();
                             return;
                         }
                     });
                 }
             });
         }
         else
         {
             tipButton.transform.localPosition = data.TipBtnPos;
             tip_Label.text = data.TipContent;
         }
         if (this.Black == null)
         {
             this.Black = this.mRoot.transform.Find("sp_black").gameObject;
         }
         StartShow();
     }
     else
     {
         this.FinishTask();
         return;
     }
 }
Beispiel #2
0
 public override void ClearTask()
 {
     if (this.tipButton)
     {
         GameObject.Destroy(this.tipButton);
     }
     if (data != null)
     {
         data = null;
     }
     this.curShowSprite = null;
     this.tip_Label     = null;
     if (this.Black)
     {
         this.Black.SetActive(false);
     }
 }