예제 #1
0
        private void Refresh()
        {
            if (this.mCurrentTabType != BeginnerTop.TabType.Basic)
            {
                return;
            }
            bool flag1 = true;

            using (List <GameObject> .Enumerator enumerator = this.mTipsItems.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TipsItem  component   = (TipsItem)enumerator.Current.GetComponent <TipsItem>();
                    TipsParam dataOfClass = DataSource.FindDataOfClass <TipsParam>(((Component)component).get_gameObject(), (TipsParam)null);
                    bool      hide        = dataOfClass.hide;
                    bool      flag2       = MonoSingleton <GameManager> .Instance.Tips.Contains(dataOfClass.iname);

                    if (!hide && !flag2)
                    {
                        flag1 = false;
                    }
                    component.IsCompleted = flag2;
                    component.IsHidden    = hide && !flag2;
                    component.Title       = !hide || flag2 ? dataOfClass.title : dataOfClass.cond_text;
                    component.UpdateContent();
                }
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BadgeTips, (UnityEngine.Object)null))
            {
                return;
            }
            this.BadgeTips.SetActive(!flag1);
        }
예제 #2
0
        private void Start()
        {
            this.mTipsParam = ((IEnumerable <TipsParam>)MonoSingleton <GameManager> .Instance.MasterParam.Tips).FirstOrDefault <TipsParam>((Func <TipsParam, bool>)(t => t.iname == GlobalVars.LastReadTips));
            if (this.mTipsParam == null)
            {
                return;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TitleText, (UnityEngine.Object)null))
            {
                this.TitleText.set_text(this.mTipsParam.title);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CloseButton, (UnityEngine.Object)null))
            {
                this.EnabledCloseButton(MonoSingleton <GameManager> .Instance.Tips.Contains(this.mTipsParam.iname));
            }
            List <Sprite> spriteList  = new List <Sprite>();
            SpriteSheet   spriteSheet = AssetManager.Load <SpriteSheet>("Tips/tips_images");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)spriteSheet, (UnityEngine.Object)null) && this.mTipsParam.images != null)
            {
                foreach (string image in this.mTipsParam.images)
                {
                    spriteList.Add(spriteSheet.GetSprite(image));
                }
            }
            this.ImageData.Images = spriteList.ToArray();
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ImageData, (UnityEngine.Object)null) && this.ImageData.Images.Length == 0)
            {
                Debug.LogError((object)"ImageData not data.");
            }
            else
            {
                this.ImageData.ImageIndex = 0;
                this.TemplatePageIcon.SetActive(false);
                for (int index = 0; index < this.ImageData.Images.Length; ++index)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.TemplatePageIcon);
                    Vector2    vector2    = Vector2.op_Implicit(gameObject.get_transform().get_localScale());
                    gameObject.get_transform().SetParent(this.ParentPageIcon.get_transform());
                    gameObject.get_transform().set_localScale(Vector2.op_Implicit(vector2));
                    gameObject.get_gameObject().SetActive(true);
                    ((UnityEngine.Object)gameObject).set_name(((UnityEngine.Object) this.TemplatePageIcon).get_name() + (index + 1).ToString());
                    this.mToggleIconList.Add((Toggle)gameObject.GetComponent <Toggle>());
                }
                this.mToggleIconList[0].set_isOn(true);
                this.SetButtonInteractable();
            }
        }