{"id":14960768,"url":"https://github.com/jdsherbert/unity-serializable-dictionary","last_synced_at":"2025-07-31T15:37:14.144Z","repository":{"id":179276632,"uuid":"663234808","full_name":"JDSherbert/Unity-Serializable-Dictionary","owner":"JDSherbert","description":"Custom C# Dictionary implementation, serializable by the Unity inspector.","archived":false,"fork":false,"pushed_at":"2024-07-12T23:28:49.000Z","size":45,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-10T10:22:21.486Z","etag":null,"topics":["csharp","csharp-code","dictionary","inspector","serialization","unity","unity-3d","unity-editor","unity-scripts","unity2d","unity3d"],"latest_commit_sha":null,"homepage":"https://linktr.ee/JDSherbert","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/JDSherbert.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":"2023-07-06T21:22:45.000Z","updated_at":"2024-07-13T20:55:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"b768967b-decf-4903-bec6-d7a76ac907fb","html_url":"https://github.com/JDSherbert/Unity-Serializable-Dictionary","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"6af9d8f71972f2e5f71b9c6967b5ffc8fa7582b2"},"previous_names":["jdsherbert/unity-serializable-dictionary"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnity-Serializable-Dictionary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnity-Serializable-Dictionary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnity-Serializable-Dictionary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FUnity-Serializable-Dictionary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDSherbert","download_url":"https://codeload.github.com/JDSherbert/Unity-Serializable-Dictionary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868059,"owners_count":16555878,"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":["csharp","csharp-code","dictionary","inspector","serialization","unity","unity-3d","unity-editor","unity-scripts","unity2d","unity3d"],"created_at":"2024-09-24T13:22:57.895Z","updated_at":"2024-10-10T10:23:02.491Z","avatar_url":"https://github.com/JDSherbert.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://github.com/JDSherbert/Unity-Serializable-Dictionary/assets/43964243/bf425086-d5ad-47b6-b38c-770e903fbf0e)\n\n# Unity - Serializable Dictionary\n\n\u003c!-- Header Start --\u003e\n  \u003ca href = \"https://docs.unity.com/\"\u003e \u003cimg align=\"left\" img height=\"40\" img width=\"40\" src=\"https://cdn.simpleicons.org/unity/white\"\u003e \u003c/a\u003e \n  \u003ca href = \"https://learn.microsoft.com/en-us/dotnet/csharp\"\u003e \u003cimg align=\"left\" img height=\"40\" img width=\"40\" src=\"https://cdn.simpleicons.org/csharp\"\u003e \u003c/a\u003e\n\u003cimg align=\"right\" alt=\"Stars Badge\" src=\"https://img.shields.io/github/stars/jdsherbert/Unity-Serializable-Dictionary?label=%E2%AD%90\"/\u003e\n\u003cimg align=\"right\" alt=\"Forks Badge\" src=\"https://img.shields.io/github/forks/jdsherbert/Unity-Serializable-Dictionary?label=%F0%9F%8D%B4\"/\u003e\n\u003cimg align=\"right\" alt=\"Watchers Badge\" src=\"https://img.shields.io/github/watchers/jdsherbert/Unity-Serializable-Dictionary?label=%F0%9F%91%81%EF%B8%8F\"/\u003e\n\u003cimg align=\"right\" alt=\"Issues Badge\" src=\"https://img.shields.io/github/issues/jdsherbert/Unity-Serializable-Dictionary?label=%E2%9A%A0%EF%B8%8F\"/\u003e\n\u003cimg align=\"right\" src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FJDSherbert%2FUnity-Serializable-Dictionary%2Fhit-counter%2FREADME\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026labelColor=0E1128\u0026title=🔍\u0026style=for-the-badge\"\u003e\n  \u003cbr\u003e\u003c/br\u003e\n  -----------------------------------------------------------------------\n  \u003ca href=\"https://unity.com/\"\u003e \n  \u003cimg align=\"top\" alt=\"Extension Tool For Unity\" src=\"https://img.shields.io/badge/Extension%20Tool%20For%20Unity-FFFFFF?style=for-the-badge\u0026logo=unity\u0026logoColor=black\u0026color=black\u0026labelColor=FFFFFF\"\u003e \u003c/a\u003e\n\n  \u003ca href=\"https://choosealicense.com/licenses/mit/\"\u003e \n  \u003cimg align=\"right\" alt=\"License\" src=\"https://img.shields.io/badge/License%20:%20MIT-black?style=for-the-badge\u0026logo=mit\u0026logoColor=white\u0026color=black\u0026labelColor=black\"\u003e \u003c/a\u003e\n  \n  -----------------------------------------------------------------------\n\n## Overview\n\nDictionaries cannot be serialized and displayed in the Unity inspector as is. \nThis pisses me off greatly, so I decided to write a quick and dirty code class to allow Dictionary Serialization in Unity.\nAdd this script to your project and discover the power of Dictionary Serialization!\n\nTo achieve serialization, the Serializable Dictionary class implements the `ISerializationCallbackReceiver` interface. This interface provides two callback methods: `OnBeforeSerialize()` and `OnAfterDeserialize()`. It also implements the `IDictionary` interface, allowing use of standard Dictionary behaviours.\n\nBy using the Serializable Dictionary class, you can easily create and manage key-value pairs directly in the Unity editor, allowing for dynamic customization and modification of data. This is particularly useful for scenarios where you need to store and modify structured data that should persist between editor sessions or during gameplay.\n\nNote that while the Serializable Dictionary class provides a convenient way to work with serialized dictionaries in Unity, it is not a built-in Unity feature. I've tried my best to replicate the default Dictionary featureset but there may be some variance.\n\n### Features:\n- Allows Dictionary display in the inspector.\n- Allows values to be serialized.\n- Functions (mostly) like a standard C# Dictionary class.\n\n### Usage:\n1. Simply add this script to your project.\n2. If you haven't got it, I'd recommend grabbing [Odin Inspector](https://github.com/TeamSirenix/odin-serializer) to make it look prettier!\n\nExample Usage:\n\n```cs\nusing UnityEngine;\nusing Sherbert.Framework.Generic;\n\npublic class DictionaryExample : MonoBehaviour\n{\n    [SerializeField] private SerializableDictionary\u003cstring, int\u003e myDictionary = new();\n}\n```\n\n -----------------------------------------------------------------------\n\n## Prerequisites\n \nIf you haven't got it, I'd strongly recommend grabbing Odin Inspector to make your serialized variables look prettier.\nYou can grab Odin from here:\n\n- Github: https://github.com/TeamSirenix/odin-serializer\n- Unity Asset Store: https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041\n\n -----------------------------------------------------------------------\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdsherbert%2Funity-serializable-dictionary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdsherbert%2Funity-serializable-dictionary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdsherbert%2Funity-serializable-dictionary/lists"}