{"id":13663196,"url":"https://github.com/ismslv/Unity_CFG","last_synced_at":"2025-04-25T13:32:15.855Z","repository":{"id":196017716,"uuid":"175547601","full_name":"ismslv/Unity_CFG","owner":"ismslv","description":"Config manager: load, parse, change","archived":false,"fork":false,"pushed_at":"2019-04-16T12:40:02.000Z","size":622,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-10T19:34:32.453Z","etag":null,"topics":["configuration","csharp","debugging","fmlht","game-development","ini-parser","testing","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ismslv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-03-14T04:23:30.000Z","updated_at":"2020-09-08T06:04:46.000Z","dependencies_parsed_at":"2023-09-21T02:48:27.364Z","dependency_job_id":null,"html_url":"https://github.com/ismslv/Unity_CFG","commit_stats":null,"previous_names":["ismslv/unity_cfg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismslv%2FUnity_CFG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismslv%2FUnity_CFG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismslv%2FUnity_CFG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismslv%2FUnity_CFG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ismslv","download_url":"https://codeload.github.com/ismslv/Unity_CFG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250825056,"owners_count":21493389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","csharp","debugging","fmlht","game-development","ini-parser","testing","unity3d"],"created_at":"2024-08-02T05:02:20.818Z","updated_at":"2025-04-25T13:32:10.809Z","avatar_url":"https://github.com/ismslv.png","language":"C#","readme":"# Unity_CFG\n![Screenshot](Screenshot.jpg)\nA simple class to store different settings in .fmcfg (or any other extension) plain text format.\n\n## Has a [VSCode extension](https://marketplace.visualstudio.com/items?itemName=FMLHT.fmcfg)\n\nVersion 1.53 supports the following data formats:\n\nstring, int, float, bool, KeyCode, string/int/float/bool/KeyCode arrays and lists, Vector2, Vector2Int, Vector3, Vector3Int and randoms between two (see the usage example).\n\nNew in this version: generic Enums.\n\n\n\n## Usage\n\nStore settings in .fmcfg file like this:\n\n```ini\n#Config.fmcfg\n\nBoardSize = 10:10 #Size of the board: width, height\nTurnsTotal = 128\nHeroName = \"Captain Jack\"\nHeroStartHealth = 0.1:0.9\nExitKey = Esc\n```\n\nTo be able to fold regions in VSCode\n```ini\n#\u003e World settings\nSetting1 = 1\nSetting2List = 2,1,3\n#\u003c\n```\n\n## Spells\n```ini\n#name Hardcore\n```\n\nDefines a config name to show in the debugger\n\n```ini\n#stop\n```\n\nStops config reading at this line.\n\nIf placed on top, disables all file and does not register it's name.\n\n```ini\nkey, mouse, joystick, axisbutton\n```\n\nAutocompletes the lists of input values.\n\nKeys according to [Unity KeyCodes](https://docs.unity3d.com/ScriptReference/KeyCode.html)\n\nMouse: Left, Right, Middle\n\nJoystick and axisbutton add support for FMLHT input module (link will be here upon a release)\n\n## Adding to a project\nTo get these settings,\nadd CFGLoader component and call it:\n\n```csharp\nCFG.Load(cfgfilepath);\n//or, to reload when testing\nCFGLoader.LoadConfig();\n\nstring name = CFG.S(\"HeroName\");\nint turns = CFG.I(\"TurnsTotal\");\nVector2Int size = CFG.V2I(\"BoardSize\");\nfloat healthHero1 = V2Rand(\"HeroStartHealth\");\nfloat healthHero2 = V2Rand(\"HeroStartHealth\");\n```\n\nAlso, it automatically loads if flag \"loadOnAwake\" is set on true.\n\nString option \"configFile\" sets the base name (by default, \"Config\").\n\nThen, \"Config.fmcfg\" will carry base configurations.\nYou can also add any amount of additional \"Config_test1.fmcfg\" files, that will be loaded upon the base, overwriting what doubles.\n\n## Generic enums\n\nTo parse generic enums:\n\n```csharp\nCharacterState state = CFG.E\u003cCharacterState\u003e(\"Hero_StateStart\");\nCharacterState[] states = CFG.AE\u003cCharacterState\u003e(\"Monster_StatesOrder\");\n```","funding_links":[],"categories":["C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismslv%2FUnity_CFG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismslv%2FUnity_CFG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismslv%2FUnity_CFG/lists"}