Exemplo n.º 1
0
        //public int GetTipCount()
        //{
        //    return m_listTipConfig.Count;
        //}

        //public SSchemeLoadingWarTip GetTipConfig(int nConfigIndex)
        //{
        //    SSchemeLoadingWarTip tipConfig = null;
        //    if (nConfigIndex >= 0 && nConfigIndex < m_listTipConfig.Count)
        //        tipConfig = m_listTipConfig[nConfigIndex];

        //    return tipConfig;
        //}

        public SSchemeLoadingWarTip GetRandTipConfig(ELoadingTipType eType = ELoadingTipType.ELTT_FIRST)
        {
            SSchemeLoadingWarTip tipConfig = null;

            do
            {
                List <SSchemeLoadingWarTip> listConfig = null;
                if (eType == ELoadingTipType.ELTT_FIRST)
                {
                    listConfig = m_listFirstTypeTip;
                }
                else if (eType == ELoadingTipType.ELTT_SECOND)
                {
                    listConfig = m_listSecondTypeTip;
                }
                if (listConfig == null || listConfig.Count <= 0)
                {
                    break;
                }

                System.Random rd            = new System.Random((int)(UnityEngine.Time.unscaledTime));
                int           nTipHintIndex = rd.Next() % listConfig.Count;
                tipConfig = listConfig[nTipHintIndex];
            }while (false);

            return(tipConfig);
        }
Exemplo n.º 2
0
        // 比赛加载界面提示
        private void LoadLoadingWarTipConfig(string stPath)
        {
            ScpReader reader = new ScpReader(stPath, true, 2);

            m_listFirstTypeTip  = new List <SSchemeLoadingWarTip>();
            m_listSecondTypeTip = new List <SSchemeLoadingWarTip>();
            for (int i = 0; i < reader.GetRecordCount(); i++)
            {
                SSchemeLoadingWarTip tipInfo = new SSchemeLoadingWarTip();
                tipInfo.nTipID      = reader.GetInt(i, (int)ELoadingWarTip.ELWT_ID, 0);
                tipInfo.nTipType    = reader.GetInt(i, (int)ELoadingWarTip.ELWT_TYPE, 0);
                tipInfo.sTipContent = reader.GetString(i, (int)ELoadingWarTip.ELWT_TIP, "");
                tipInfo.sTipTitle   = reader.GetString(i, (int)ELoadingWarTip.ELWT_TITLE, "");

                if (tipInfo.nTipType == (int)ELoadingTipType.ELTT_FIRST)
                {
                    m_listFirstTypeTip.Add(tipInfo);
                }
                else if (tipInfo.nTipType == (int)ELoadingTipType.ELTT_SECOND)
                {
                    m_listSecondTypeTip.Add(tipInfo);
                }
            }
        }