예제 #1
0
 private void CreateObjects()
 {
     this.CastItemCount = 3;
     this.castTrinketItems = new GUIPillageCastingPopUp.CastTrinketItem[this.CastItemCount];
     this.mSelectTrinketPopUp = GameUITools.FindGameObject("SelectTrinketPopUp", base.gameObject).AddComponent<SelectTrinketPopUp>();
     this.mSelectTrinketPopUp.Init(this);
     this.mSelectTrinketPopUp.Hide();
     GameUITools.RegisterClickEvent("FadeBG", new UIEventListener.VoidDelegate(this.OnCloseClick), base.gameObject);
     this.mBG = GameUITools.FindGameObject("BG", base.gameObject);
     GameUITools.RegisterClickEvent("CloseBtn", new UIEventListener.VoidDelegate(this.OnCloseClick), this.mBG);
     GameObject gameObject = GameUITools.FindGameObject("Desc", this.mBG);
     this.mName = GameUITools.FindUILabel("Name", gameObject);
     this.mValue0 = GameUITools.FindUILabel("Value0", gameObject);
     this.mValue1 = GameUITools.FindUILabel("Value1", gameObject);
     gameObject = GameUITools.FindGameObject("Right", this.mBG);
     this.mRecipeContent = GameUITools.FindGameObject("RecipeContent", gameObject);
     this.mUI59 = GameUITools.FindGameObject("ui59", this.mRecipeContent);
     this.mUI59.gameObject.SetActive(false);
     Tools.SetParticleRenderQueue(this.mUI59, 3300, 0.68f);
     this.mRightQuality = GameUITools.RegisterClickEvent("Trinket", new UIEventListener.VoidDelegate(this.OnTrinketClick), this.mRecipeContent).GetComponent<UISprite>();
     this.mRightIcon = GameUITools.FindUISprite("Icon", this.mRightQuality.gameObject);
     this.mRightTrinketName = GameUITools.FindUILabel("Name", this.mRightQuality.gameObject);
     this.mRightTips = GameUITools.FindUILabel("Tips", gameObject);
     this.mRightName = GameUITools.FindUILabel("Name", this.mRightTips.gameObject);
     GameUITools.RegisterClickEvent("AutoAddBtn", new UIEventListener.VoidDelegate(this.OnAutoAddBtnClick), gameObject);
     GameUITools.RegisterClickEvent("CastingBtn", new UIEventListener.VoidDelegate(this.OnCastingBtnClick), gameObject);
     gameObject = GameUITools.FindGameObject("Items", this.mBG);
     int num = Mathf.Min(gameObject.transform.childCount, 4) - 1;
     int i = 0;
     foreach (ItemInfo current in Globals.Instance.AttDB.ItemDict.Values)
     {
         if (current.Type == 1 && current.Quality == 4)
         {
             if (i > num)
             {
                 break;
             }
             GUIPillageCastingPopUp.CastItem castItem = gameObject.transform.GetChild(i).gameObject.AddComponent<GUIPillageCastingPopUp.CastItem>();
             castItem.Init(current, new GUIPillageCastingPopUp.CastItem.SelectCallback(this.OnSelect));
             if (i == 0)
             {
                 this.OnSelect(castItem);
             }
             i++;
         }
     }
     while (i <= num)
     {
         gameObject.transform.GetChild(i).gameObject.SetActive(false);
         i++;
     }
 }
 protected override void InitObjects()
 {
     this.mBaseScene = (this.mOriginal as SelectTrinketPopUp);
     base.transform.localScale = new Vector3(0.93f, 0.9f, 1f);
 }