Exemplo n.º 1
0
	public void Load()
	{
		CSVReader reader = new CSVReader();
		reader.LoadText("Config/Disassemblygirl_Gold.txt", 3);
		int rows = reader.GetRowCount();
		for (int r = 0; r < rows; ++r)
		{
			string[] row = reader.GetRow(r);
			DisassemblygirlGoldConfig ac = ConfigProcess(row) as DisassemblygirlGoldConfig;
			configs.Add(ac.id, ac);
		}
	}
Exemplo n.º 2
0
	public object ConfigProcess(string[] row)
	{
		if (row.Length < 4)
		{
			return null;
		}

		RowHelper rh = new RowHelper(row);
		DisassemblygirlGoldConfig rec = new DisassemblygirlGoldConfig();

		rec.id = CSVUtility.ToInt(rh.Read());	//id
		rec.name = rh.Read();	//名字
		rec.iconID = rh.Read();	//图标ID
		rec.value = CSVUtility.ToInt(rh.Read());	//数值
		return rec;
	}
Exemplo n.º 3
0
        public IEnumerator Shuffle()
        {
            DisassemblygirlGoldConfigTable goldTable = ConfigMgr.GetInstance().DisassemblygirlGold;

            int lastValue = default(int);

            while (true)
            {
                int value = Random.Range(1, goldTable.configs.Count);
                if (value == lastValue)
                {
                    value = (value == goldTable.configs.Count ? value - 1 : value + 1);
                }

                lastValue = value;

                DisassemblygirlGoldConfig config = goldTable.GetConfigById(lastValue);
                iconImg.spriteName = config.iconID;
                data.name          = goldTable.GetConfigById(lastValue).name;
                data.value         = config.value;

                yield return(new WaitForSeconds(0.08f));
            }
        }