public static CharacterConfig ReadCharacterConfig(string characterName) { CharacterConfig config = ConfigReader.Parse <CharacterConfig>(ResourceLoader.LoadText("Chars/" + characterName + "/" + characterName + ".def")); ActionsConfig actionsConfig = ConfigReader.Parse <ActionsConfig>(ResourceLoader.LoadText(config.action)); string commands = ResourceLoader.LoadText(config.command); config.SetActions(actionsConfig.actions.ToArray()); config.SetCommand(commands); return(config); }
protected void InitCore() { Core.Debug.Log = Log.Info; Core.Debug.LogWarn = Log.Warn; Core.Debug.LogError = Log.Error; Core.Debug.Assert = Log.Assert; Core.LuaMgr.AddLoader(LuaLoader); Core.FileReader.AddReader(FileRead); if (GUIDebug.Instance != null) { Core.Debug.AddGUIDebugMsg = GUIDebug.Instance.AddMsg; } Core.SystemConfig.Instance.Init(ResourceLoader.LoadText("Config/System.cfg")); }
protected void CreateGame(MatchInfo matchInfo, int logicFPS) { StageConfig stageConfig = ConfigReader.Parse <StageConfig>(ResourceLoader.LoadText("Stage/" + matchInfo.stage + "/" + matchInfo.stage + ".def")); WorldConfig worldConfig = new WorldConfig(); worldConfig.SetStageConfig(stageConfig); this.game = new Game(matchInfo, worldConfig, logicFPS); LoadFightHud(); viewWorld = new ViewWorld(game.world); viewWorld.InitScene(this.gameObject); viewWorld.CreateStage(worldConfig.stageConfig.stage); viewWorld.CreateCamera(this.game.world.cameraController); }
public void Awake() { m_uiDefs = Core.ConfigReader.Parse <Dictionary <string, UIDef> >(ResourceLoader.LoadText("UIDef")); /* * //Add Test * m_uiDefs.Add("test", new UIDef() { name = "test", script = "hehe", prefab = "1/2/2" }); * YamlDotNet.Serialization.Serializer serializer = new Serializer(); * StringWriter strWriter = new StringWriter(); * serializer.Serialize(strWriter, m_uiDefs); * using (TextWriter writer = File.CreateText("Assets/Resources/UIDef.txt")) * { * writer.Write(strWriter.ToString()); * } */ }
private static string FileRead(ref string fileName) { return(ResourceLoader.LoadText(fileName)); }