Ejemplo n.º 1
0
    private static void OnPostprocessEquipment()
    {
        string     path = System.IO.Path.Combine(RESOURCE_DATA_FOLDER, "JokeConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <JokeConfigData> tempList = new List <JokeConfigData>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                //if (0 == i) continue;
                JokeConfigData data = new JokeConfigData();
                data.ID        = Convert.ToInt32(sheet["ID"][i]);
                data.IDS       = Convert.ToString(sheet["IDS"][i]);
                data.DelayTime = Convert.ToInt32(sheet["Time"][i]);
                tempList.Add(data);
            }


            CreateMedicamentConfigDataList(tempList);
        }
    }
Ejemplo n.º 2
0
    //开始显示笑话//
    private void ShowJokeTip()
    {
        JokeConfigData joke = SelectJoke();

        if (joke == null)
        {
            return;
        }
        jokeTipLabel.text = GetString(joke.IDS);
        if (IsInvoking("ShowJokeTip"))
        {
            CancelInvoke("ShowJokeTip");
        }
        Invoke("ShowJokeTip", joke.DelayTime);
    }