Example #1
0
        private void RefreshTypeForm(CUIFormScript typeForm = null)
        {
            if (typeForm == null)
            {
                typeForm = Singleton <CUIManager> .GetInstance().GetForm("UGUI/Form/System/Achieve/Form_Achievement_Type.prefab");
            }
            if (typeForm != null)
            {
                CAchieveInfo achieveInfo           = CAchieveInfo.GetAchieveInfo();
                int          gotRewardAchievePoint = achieveInfo.GetGotRewardAchievePoint(0);
                int          totalAchievePoint     = achieveInfo.GetTotalAchievePoint(0);
                string[]     args = new string[] { gotRewardAchievePoint.ToString(), totalAchievePoint.ToString() };
                typeForm.GetWidget(0).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Achievement_My_Point", args);

                string[] textArray2 = new string[] { (this.m_worldRank != 0) ? this.m_worldRank.ToString() : Singleton <CTextManager> .GetInstance().GetText("Common_Not_In_Rank") };
                typeForm.GetWidget(1).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Achievement_World_Rank", textArray2);

                Transform transform = typeForm.GetWidget(2).transform;
                for (int i = 0; i < transform.childCount; i++)
                {
                    Transform child       = transform.GetChild(i);
                    int       achieveType = i + 1;
                    int       finish      = achieveInfo.GetGotRewardAchievePoint(achieveType);
                    int       total       = achieveInfo.GetTotalAchievePoint(achieveType);
                    string[]  textArray3  = new string[] { finish.ToString(), total.ToString() };
                    child.Find("txtProcess").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Achievement_Type_Process_Format", textArray3);

                    if ((finish < total) || (total == 0))
                    {
                        child.Find("imgProcessCircle").GetComponent <Image>().fillAmount = this.GetProcessCircleFillAmount(finish, total);
                        if (total == 0)
                        {
                            child.Find("imgNotFinishBg").GetComponent <Image>().color      = Color.grey;
                            child.Find("imgIcon").GetComponent <Image>().color             = Color.grey;
                            child.GetComponent <CUIEventScript>().m_onClickEventParams.tag = 1;
                            if (CSysDynamicBlock.bUnfinishBlock)
                            {
                                child.gameObject.CustomSetActive(false);
                            }
                        }
                    }
                    else
                    {
                        child.Find("imgNotFinishBg").gameObject.CustomSetActive(false);
                        child.Find("imgProcessCircle").gameObject.CustomSetActive(false);
                        child.Find("imgFinishBg").gameObject.CustomSetActive(true);
                        child.Find("imgAllComplishMark").gameObject.CustomSetActive(true);
                    }
                    child.Find("imgRedPoint").gameObject.CustomSetActive(achieveInfo.IsHaveFinishButNotGetRewardAchievement(achieveType));
                }
            }
        }
Example #2
0
        private void OnAchieveStateUpdate()
        {
            CAchieveInfo achieveInfo = CAchieveInfo.GetAchieveInfo();

            if (achieveInfo != null)
            {
                if (achieveInfo.IsHaveFinishButNotGetRewardAchievement(0))
                {
                    Singleton <LobbyUISys> .GetInstance().AddRedDot(enSysEntryID.AchievementBtn, enRedDotPos.enTopRight);
                }
                else
                {
                    Singleton <LobbyUISys> .GetInstance().DelRedDot(enSysEntryID.AchievementBtn);
                }
            }
        }