Пример #1
0
 public void Init(GUIRewardScratchOffPop basepop, int brushSize, float per)
 {
     this.mBasePop = basepop;
     this.uiTex = base.gameObject.GetComponent<UITexture>();
     this.mNum = GameUITools.FindUILabel("Label", base.gameObject);
     this.percent = per;
     if (this.uiTex != null)
     {
         this.tex = (Texture2D)this.uiTex.mainTexture;
         this.mWidth = this.tex.width;
         this.mHeight = this.tex.height;
         this.brushSize = ((basepop.mBaseScene.mBaseScene.ScratchOffBrushSize <= 0) ? 10 : basepop.mBaseScene.mBaseScene.ScratchOffBrushSize);
         this.area = this.mWidth * this.mHeight;
         this.cols = this.tex.GetPixels();
     }
 }
Пример #2
0
 protected void CreateObjects()
 {
     this.mRemainingTime = GameUITools.FindUILabel("RemainingTime", base.gameObject);
     this.mDiamond = GameUITools.FindUILabel("Diamond", base.gameObject);
     GameObject parent = GameUITools.FindGameObject("Infos", base.gameObject);
     this.mPlayBtnLabel = GameUITools.FindUILabel("Label", GameUITools.RegisterClickEvent("PlayBtn", new UIEventListener.VoidDelegate(this.OnPlayBtnClick), parent));
     this.mCurCost = GameUITools.FindUILabel("CurCost", parent);
     this.mCount = GameUITools.FindUILabel("Count", parent);
     for (int i = 0; i < 3; i++)
     {
         this.mAreaArr[i] = GameUITools.FindGameObject(i.ToString(), parent).AddComponent<GUIRewardArea>();
     }
     this.mRemainingTime.text = string.Empty;
     this.mDiamond.text = string.Empty;
     this.mPop = GameUITools.FindGameObject("Pop", base.gameObject).AddComponent<GUIRewardScratchOffPop>();
     this.mPop.Init(this);
     this.mPop.gameObject.SetActive(false);
     VipLevelInfo info = Globals.Instance.AttDB.VipLevelDict.GetInfo(16);
     if (info == null)
     {
         global::Debug.LogErrorFormat("VipLevelDict get info error , ID : {0} ", new object[]
         {
             16
         });
         this.freeCount = 0;
     }
     this.freeCount = info.ScratchOff;
 }