Пример #1
0
 public void Init(int index, GUIGuardScene.Item.ClickCallBack cb)
 {
     UILabel uILabel = GameUITools.FindUILabel("Name", base.gameObject);
     this.mLevel = GameUITools.FindUILabel("Level", base.gameObject);
     MGInfo info = Globals.Instance.AttDB.MGDict.GetInfo(index * 3 + 1);
     if (info == null)
     {
         global::Debug.LogError(new object[]
         {
             "MGDict get info error , ID : {0} ",
             index * 3 + 1
         });
         return;
     }
     if (Tools.CanPlay(info.MinLevel, true))
     {
         this.mLevel.text = Singleton<StringManager>.Instance.GetString("guard4", new object[]
         {
             info.MinLevel
         });
     }
     else
     {
         this.isOpen = false;
         this.mLevel.text = Singleton<StringManager>.Instance.GetString("guard3", new object[]
         {
             info.MinLevel
         });
         uILabel.color = Tools.GetDisabledTextColor(222);
         this.mLevel.color = Tools.GetDisabledTextColor(222);
         uILabel.effectStyle = UILabel.Effect.None;
         this.mLevel.effectStyle = UILabel.Effect.None;
         uILabel.applyGradient = false;
         this.mLevel.applyGradient = false;
         base.gameObject.GetComponent<UITexture>().color = Color.black;
         UIButton[] componentsInChildren = base.gameObject.GetComponentsInChildren<UIButton>();
         UIButton[] array = componentsInChildren;
         for (int i = 0; i < array.Length; i++)
         {
             UIButton uIButton = array[i];
             uIButton.enabled = false;
         }
     }
     this.index = index;
     this.OnClickEvent = cb;
 }
Пример #2
0
 public void Init(GUIGuardScene basescene)
 {
     this.mBaseScene = basescene;
     this.CreateObjects();
 }