예제 #1
0
        private void CalcResult()
        {
            LevelResultFormData data = new LevelResultFormData();

            if (m_Victory == false)
            {
                data.Victory   = false;
                data.StarCount = 0;
                data.GlodAward = 0;
                data.ExpAward  = 0;
                GameEntry.UI.OpenUIForm(UIFormId.LevelResultForm, data);
                return;
            }

            DRLevel drLevel = GameEntry.DataTable.GetDataTable <DRLevel>().GetDataRow(LevelID);

            if (drLevel == null)
            {
                Log.Error("the level dr data is no exist.");
                return;
            }

            int starCount = CalcStar(drLevel);
            int money     = drLevel.GetMoneyRatio;
            int exp       = drLevel.GetExpRatio;


            data.Victory   = true;
            data.StarCount = starCount;
            data.GlodAward = money;
            data.ExpAward  = exp;
            GameEntry.UI.OpenUIForm(UIFormId.LevelResultForm, data);
        }
예제 #2
0
        protected override void OnOpen(object userData)
        {
            base.OnOpen(userData);

            m_Data = userData as LevelResultFormData;
            if (m_Data == null)
            {
                return;
            }

            m_Ctrl.selectedIndex = m_Data.Victory ? 0 : 1;
            m_Star.SetStar(m_Data.StarCount);
            m_Gold.text = m_Data.GlodAward.ToString();
            m_Exp.text  = m_Data.ExpAward.ToString();
        }