{"id":23543879,"url":"https://github.com/beatthat/defines","last_synced_at":"2026-04-18T06:37:25.001Z","repository":{"id":144017037,"uuid":"139877935","full_name":"beatthat/defines","owner":"beatthat","description":"Make the define symbols in Unity projects discoverable and easy to enable/disable with an editor window.","archived":false,"fork":false,"pushed_at":"2018-09-07T16:37:29.000Z","size":874,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T08:43:07.362Z","etag":null,"topics":["csharp","npm","package","plugin","unity","unity3d","unpm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beatthat.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-05T16:56:47.000Z","updated_at":"2025-04-04T03:31:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"b75cab74-7b30-45e5-9433-f8ef0a854ce8","html_url":"https://github.com/beatthat/defines","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/beatthat/defines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beatthat%2Fdefines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beatthat%2Fdefines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beatthat%2Fdefines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beatthat%2Fdefines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beatthat","download_url":"https://codeload.github.com/beatthat/defines/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beatthat%2Fdefines/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31959883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["csharp","npm","package","plugin","unity","unity3d","unpm"],"created_at":"2024-12-26T07:11:54.389Z","updated_at":"2026-04-18T06:37:24.963Z","avatar_url":"https://github.com/beatthat.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003ca name=\"readme\"\u003e\u003c/a\u003eDefines - Unity\n\nMake the define symbols in Unity projects discoverable and easy to enable/disable with an editor window.\n\n## Usage\n\n#### Define/Undefine Symbols\n\nFollow these steps to define or undefine symbols already annotated in your project's code:\n\n1. ```Window =\u003e Define Scripting Symbols```\n2. Check/uncheck symbols in the list\n3. Tap ```Save```\n\n![Launch Window](READMEfiles/images/launch-window.gif)\n\n#### Use ```[EditDefine]``` to Make a Define Option Show in the ```Define Scripting Symbols``` Window\n\nFor any define that you want visible in the Define Scripting Symbols window, add ```[EditDefine]``` to at least one class. The attribute must be applied to a class, not a method or other.\n\n```csharp\n[EditDefine(\n    \"MY_CUSTOM_DEFINE\",\n    \"When defined, MyClass does something different on Start\"\n    )\n]\npublic class MyClass\n{\n    void Start()\n    {\n        #if MY_CUSTOM_DEFINE\n        // some custom behavior\n        #endif\n    }\n}\n```\n\n#### Create an options-style define by passing an array of symbols to ```[EditDefine]```\n\nDefines can be useful switching among a set of configuration options. A common example is configuring which env 'stage' your server-connected app is pointing at, e.g. dev or production.\n\n```csharp\n[EditDefine(\n    new string[] {\n        \"ENV_PRODUCTION\",\n        \"ENV_DEV\",\n        \"ENV_DEVLOCAL\"\n    },\n    \"Toggle the server environment\"\n    )\n]\npublic class ServerConfig\n{\n    public const string HOST =\n    #if ENV_DEVLOCAL\n        \"http://localhost:3001\";\n    #elif ENV_DEV\n        \"http://dev.mydomain.com\";\n    #else\n        \"http://mydomain.com\";\n    #endif\n}\n```\n\n![Options](READMEfiles/images/options.gif)\n\n## Install\n\nFrom your unity project folder:\n\n    npm init\n    npm install beatthat/defines --save\n\n## Development\n\nYou can edit the code and samples in the test environment and then use ```npm run overwrite:test2src``` to sync changes back to the package src.\n\n```\n    npm run install:test\n    cd test\n\n    # edit code under Assets/Plugins/packages/beatthat/defines\n    # edit samples under Assets/Samples/packages/beatthat/defines\n\n    # sync changes back to src\n    npm run overwrite:test2src\n```\n\n**REMEMBER:** changes made under the test folder are not saved to the package\nunless they are copied back into the source folder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeatthat%2Fdefines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeatthat%2Fdefines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeatthat%2Fdefines/lists"}