{"id":26232954,"url":"https://github.com/insthync/unity-serialization-surrogates","last_synced_at":"2026-04-27T14:05:20.504Z","repository":{"id":80411342,"uuid":"122170728","full_name":"insthync/unity-serialization-surrogates","owner":"insthync","description":"Serialization surrogates for Unity's structs","archived":false,"fork":false,"pushed_at":"2025-03-02T17:57:00.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T01:51:20.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/insthync.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-02-20T08:10:00.000Z","updated_at":"2025-03-02T18:47:17.000Z","dependencies_parsed_at":"2025-03-13T00:45:17.094Z","dependency_job_id":"1a215feb-9485-46c6-bda7-628428d13310","html_url":"https://github.com/insthync/unity-serialization-surrogates","commit_stats":null,"previous_names":["insthync/unity-serialization-surrogates","insthync/unity3d-serialization-surrogates"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/insthync/unity-serialization-surrogates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insthync%2Funity-serialization-surrogates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insthync%2Funity-serialization-surrogates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insthync%2Funity-serialization-surrogates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insthync%2Funity-serialization-surrogates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insthync","download_url":"https://codeload.github.com/insthync/unity-serialization-surrogates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insthync%2Funity-serialization-surrogates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32339332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":[],"created_at":"2025-03-13T00:45:30.483Z","updated_at":"2026-04-27T14:05:20.463Z","avatar_url":"https://github.com/insthync.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unity3d-serialization-surrogates\nSerialization surrogates for Unity's structs\n\n**Can make formatter to serialize and deserialize:**\n* Color\n* Quaternion\n* Vector2Int\n* Vector2\n* Vector3Int\n* Vector3\n* Vector4\n\n## Usage Example\n**Serialize**\n```csharp\nusing (var memoryStream = new MemoryStream())\n{\n    var binaryFormatter = new BinaryFormatter();\n    // Setup Unity's structs serialization surrogates\n    var surrogateSelector = new SurrogateSelector();\n    surrogateSelector.AddAllUnitySurrogate();\n    binaryFormatter.SurrogateSelector = surrogateSelector;\n    // Serialize and put to packet\n    binaryFormatter.Serialize(memoryStream, data);\n    memoryStream.Flush();\n    memoryStream.Seek(0, SeekOrigin.Begin);\n    var bytes = memoryStream.ToArray();\n}\n```\n\n**Deserialize**\n```csharp\nusing (MemoryStream memoryStream = new MemoryStream(bytes))\n{\n    BinaryFormatter binaryFormatter = new BinaryFormatter();\n    // Setup Unity's structs serialization surrogates\n    var surrogateSelector = new SurrogateSelector();\n    surrogateSelector.AddAllUnitySurrogate();\n    binaryFormatter.SurrogateSelector = surrogateSelector;\n    // Deserialize\n    var data = binaryFormatter.Deserialize(memoryStream);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsthync%2Funity-serialization-surrogates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsthync%2Funity-serialization-surrogates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsthync%2Funity-serialization-surrogates/lists"}