//private static bool startup = false; public GameController() { Debug.Log("GameController."); CurrentGameMode = GameMode.NORMAL; GameControlProxy.add(this); WindowConfigure.initAll(); if (Rnd == null) Rnd = new RndGenerator((int)System.DateTime.Now.Ticks); if (GameActionEvent == null) GameActionEvent = new GameActionEvent(); if (PlayingLogger == null) PlayingLogger = new PlayLogger(); if (DungeonInformation == null) DungeonInformation = new DungeonInformation(); if (ObjectList == null) ObjectList = new ObjectList(); if (DgParameterTable == null) DgParameterTable = new DungeonParameterTable(5); if (SoundController == null) SoundController = SoundController.Instance; if (TempGameState == null) TempGameState = new Stack<GameState>(); if (ActCommandController == null) ActCommandController = new ActionCommandController(); if (GlobalGameInformation == null) GlobalGameInformation = new GlobalGameInformation(); if (SystemConfigure == null) SystemConfigure = new SystemConfigure(); if (SystemConfigureMenu == null) SystemConfigureMenu = new GameSystemConfigureMenu(); DataSaveSystem.addGameActionEvent(); //var t = new TagList(); SaveDataConverter.add(this); //PlayerUIController.setVisible(false); gameStateChange(GameState.PRELOAD); filedModeChange(FieldMode.TOWN); }
public void setDungeonData(DungeonInformation dginfo, DungeonParameterTable dgparamtable) { LocalDgData = new LocalDungeonData(dginfo, dgparamtable); var clist = LocalDgData.DgInfo.Enemys.ToList(); clist.Add(Player.EntityData); foreach (var enemy in clist) { enemy.setAttackerLog(clist); } }
private static bool saveFile(uint filenumber,PlayerController player,DungeonInformation dginfo, DungeonParameterTable dgpramtable) { if (filenumber >= filename.Length) throw new ArgumentOutOfRangeException(); string savepath = savedir + @"\" + filename[filenumber]; LocalSaveData lcs = new LocalSaveData(); lcs.setPlayerData(player); lcs.setDungeonData(dginfo,dgpramtable); lcs.setGlobalGameInformation(GameController.GlobalGameInformation); string json = JsonUtility.ToJson(lcs,true); Debug.Log(json); using (FileStream fs = new FileStream(savepath, FileMode.Create, FileAccess.Write)){ BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(fs, json); return true; } return false; }