{"id":13785430,"url":"https://github.com/ulrikdamm/UnityNonNull","last_synced_at":"2025-05-11T21:30:30.502Z","repository":{"id":139583710,"uuid":"172743918","full_name":"ulrikdamm/UnityNonNull","owner":"ulrikdamm","description":"[NonNull] attribute to fields and classes in Unity","archived":false,"fork":false,"pushed_at":"2019-04-08T14:29:12.000Z","size":45,"stargazers_count":44,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-17T21:39:23.513Z","etag":null,"topics":["editor","null","unity","unity3d"],"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/ulrikdamm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-02-26T16:02:38.000Z","updated_at":"2024-11-15T15:06:48.000Z","dependencies_parsed_at":"2024-01-17T05:12:51.267Z","dependency_job_id":"b94c8b69-7a7d-4c06-8601-a9de2f3f3626","html_url":"https://github.com/ulrikdamm/UnityNonNull","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulrikdamm%2FUnityNonNull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulrikdamm%2FUnityNonNull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulrikdamm%2FUnityNonNull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulrikdamm%2FUnityNonNull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulrikdamm","download_url":"https://codeload.github.com/ulrikdamm/UnityNonNull/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253638726,"owners_count":21940414,"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":["editor","null","unity","unity3d"],"created_at":"2024-08-03T19:01:00.242Z","updated_at":"2025-05-11T21:30:30.124Z","avatar_url":"https://github.com/ulrikdamm.png","language":"C#","readme":"# UnityNonNull\n\nSmall package to add a `[NonNull]` attribute. Put this on a field to make it highlight in the editor when the field haven't been assigned, or on a class to automatically make it apply to all fields in that class. When you put in on a class, you can also put `[AllowNull]` on specific fields to allow them to be unassigned.\n\n![](http://ufd.dk/NonNullEditor.png)\n\nThe script will also produce an error when you play the game in the editor or when you make a build if you have any unassigned references in your scenes.\n\n![](http://ufd.dk/NonNullError.png)\n\nThis is handy to make sure something doesn't get unassigned by accident. You can also check wether an object is still in use or not by removing it, and then making a build, and see if you get any errors for unassigned references.\n\nFields with unassigned references many times only have one reference you could possibly assign to it; a `GameManager` field probably wants to refer to the `GameManager` MonoBehaviour in the scene, and a `LocalizationsHandler` field probably wants to refer to the single `LocalizationsHandler` ScriptableObject in your assets. In these cases, the editor will show a \"fill\" button next to the field, which will automatically fill out the reference. If it could possibly refer to multiple things, like a Rigidbody reference, there won't be a fill button, since it can't be automatically filled.\n\nFor value types, the package comes with a `[NonEmpty]` attribute, which can be used to check that lists and strings aren't empty, colors aren't unassigned, enums aren't the default case, numbers aren't zero, and so on.\n\n## Installation\n\nYou can drop the NonNullAttribute.cs into your Assets folder (but it does *not* go in the Editor folder), or you can install it via the Unity package manager (recommended!) by adding this line to your Packages/manifest.json file:\n\n`\"co.northplay.nonnull\": \"https://github.com/ulrikdamm/UnityNonNull.git\"`\n\nAnd it will appear in the package manager and automatically install into your project.\n","funding_links":[],"categories":["Attribute"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulrikdamm%2FUnityNonNull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulrikdamm%2FUnityNonNull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulrikdamm%2FUnityNonNull/lists"}