Ejemplo n.º 1
0
        public void OnEnterScene(uint sceneid)
        {
            _time = 0;
            XLevelScriptMgr.singleton.CommandCount = 0;
            string configFile = XScene.singleton.SceneRow.SceneFile;

            if (configFile.Length == 0)
            {
                _curSpawner = null;
                XLevelScriptMgr.singleton.ClearWallInfo();
                XLevelScriptMgr.singleton.Reset();
                return;
            }

            if (_curSpawner == null)
            {
                _curSpawner = new XLevelSpawnInfo();
            }
            else
            {
                _curSpawner.Clear();
            }
            Stream s = XResources.ReadText("Table/" + configFile);
            //using (StreamReader sr = new StreamReader(s))
            StreamReader sr = new StreamReader(s);
            {
                string line      = sr.ReadLine();
                int    totalWave = int.Parse(line);
                line = sr.ReadLine();
                int PreloadWave = int.Parse(line);
                for (int i = 0; i < PreloadWave; i++)
                {
                    line = sr.ReadLine();
                    string[] info    = line.Split(',');
                    int      enemyID = int.Parse(info[0].Substring(3));
                    int      count   = int.Parse(info[1]);
                    _curSpawner.preloadInfo.Add(enemyID, count);
                }
                for (int id = 0; id < totalWave; id++)
                {
                    XLevelWave wave = new XLevelWave();
                    wave.ReadFromFile(sr);
                    _curSpawner.waves.Add(wave);

                    XLevelDynamicInfo dInfo = new XLevelDynamicInfo();
                    dInfo.id         = wave.ID;
                    dInfo.totalCount = wave.Count;
                    dInfo.Reset();
                    _curSpawner.wavesDynamicInfo.Add(wave.ID, dInfo);
                }

                XResources.ClearStream(s);
            }
        }
Ejemplo n.º 2
0
 public XLevelSpawnTask(XLevelSpawnInfo spawn) : base(spawn)
 {
     isSummonTask = false;
 }
Ejemplo n.º 3
0
 public XLevelScriptTask(XLevelSpawnInfo ls) : base(ls)
 {
 }
Ejemplo n.º 4
0
 public XLevelBaseTask(XLevelSpawnInfo spawn)
 {
     _spawner = spawn;
 }