{"id":15160747,"url":"https://github.com/sassyasssas/playerloop-extension","last_synced_at":"2026-01-20T04:32:40.253Z","repository":{"id":248300360,"uuid":"825754351","full_name":"SassyAssSas/playerloop-extension","owner":"SassyAssSas","description":"Lightweight unity asset package that provides a convenient way of editing Unity's PlayerLoop.","archived":false,"fork":false,"pushed_at":"2024-10-05T21:10:55.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T22:16:56.776Z","etag":null,"topics":["csharp","playerloop","unity","unity-package","unity-scripts","unity2d","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/SassyAssSas.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":"2024-07-08T12:35:58.000Z","updated_at":"2024-10-05T21:10:59.000Z","dependencies_parsed_at":"2024-09-26T23:22:26.991Z","dependency_job_id":"989b1ba2-3491-4645-a596-32f74f809018","html_url":"https://github.com/SassyAssSas/playerloop-extension","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"0757ff637d0c7df18a4b3dc26cf71ce153e5285f"},"previous_names":["sassyasssas/playerloop-extension"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SassyAssSas%2Fplayerloop-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SassyAssSas%2Fplayerloop-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SassyAssSas%2Fplayerloop-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SassyAssSas%2Fplayerloop-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SassyAssSas","download_url":"https://codeload.github.com/SassyAssSas/playerloop-extension/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247724881,"owners_count":20985600,"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","playerloop","unity","unity-package","unity-scripts","unity2d","unity3d"],"created_at":"2024-09-26T23:22:13.594Z","updated_at":"2026-01-20T04:32:40.224Z","avatar_url":"https://github.com/SassyAssSas.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- omit from toc --\u003e\n# PlayerLoop Extension\nProvides a convenient way of editing Unity's PlayerLoop.\n\n\u003c!-- omit from toc --\u003e\n## Table of contents\n- [Installation](#installation)\n- [PlayerLoopBuilder](#playerloopbuilder)\n- [PlayerLoopSystem extension methods](#playerloopsystem-extension-methods)\n- [Editor mode nuanses](#editor-mode-nuanses)\n\n## Installation\nTo start using the package, go to [releases page](https://github.com/SassyAssSas/playerloop-extension/releases) and get the release of your choice.\n\n## PlayerLoopBuilder\nTo start working with the library use the `Violoncello.PlayerLoopExtensions` namespace.\n\nTo edit the PlayerLoop use `PlayerLoopBuilder` class. There are 3 ways to get an instance of `PlayerLoopBuilder`. You can see them all on the example below:\n```csharp\n// Will return a new instance PlayerLoopBuilder with empty player loop:\nPlayerLoopBuilder.FromNew();\n\n// Will return a new instance PLayerLoopBuilder that already contains default PlayerLoop systems:\nPlayerLoopBuilder.FromDefault();\n\n// Will return a new instance PLayerLoopBuilder that contains all the current PlayerLoop systems:\nPlayerLoopBuilder.FromCurrent();\n``` \n\n`PlayerLoopBuilder` object is used to add and remove systems in the PlayerLoop using methods shown on the example below:\n```csharp\n// All the creation methods return the instance of PlayerLoopBuilder\n// So you can proceed to editing immediately\nPlayerLoopBuilder.FromCurrent()\n                 .AddToRoot(mySystem)\n                 .AddToSubSystem\u003cUpdate\u003e(mySystem)\n                 .AddToRoot\u003cMySystem\u003e(Callback) \n                 .AddToSubSystem\u003cUpdate, MySystem\u003e(Callback)\n                 .RemoveFromRoot\u003cMySystem\u003e()\n                 .RemoveFromSubSystem\u003cUpdate, MySystem\u003e()\n                 .RemoveFromRoot(typeof(MySystem))\n                 .RemoveFromSubSystem(typeof(Update), typeof(MySystem));\n```\nWhen you finish working with the builder you can either call the `PlayerLoopBuilder.Build` method to get a result `PlayerLoopSystem`:\n```csharp\nvar playerLoop = PlayerLoopBuilder.FromCurrent()\n                                  .AddToSubSystem\u003cUpdate, MyUpdate\u003e(MyUpdateCallback)\n                                  .AddToSubSystem\u003cFixedUpdate, MyFixedUpdate\u003e()\n                                  .Build();\n\n// Will set the result PlayerLoopSystem as unity's main PlayerLoop \nPlayerLoop.SetPlayerLoop();\n```\nOr call `PlayerLoopBuilder.SetPlayerLoop()` which will set the result `PlayerLoopSystem` as unity's default PlayerLoop without you having to retrieve the result `PlayerLoopSystem` and doing it yourself: \n```csharp\nPlayerLoopBuilder.FromCurrent()\n                 .AddToSubSystem\u003cUpdate, MyUpdate\u003e(MyUpdateCallback)\n                 .AddToSubSystem\u003cFixedUpdate, MyFixedUpdate\u003e()\n                 .SetPlayerLoop();\n```\n\n## PlayerLoopSystem extension methods\nIf you need to edit a `PlayerLoopSystem`, you might make a use of it's new extension methods:\n```csharp\n// Searches for a subSystem with the passed type and returns it.\n// Throws an exception if doesn't find the subSystem\nplayerLoopSystem.FindSubSystem\u003cMySystem\u003e();\nplayerLoopSystem.FindSubSystem(typeof(MySystem));\n\n// Searches for a subSystem with the passed type and puts it in the out variable.\n// Returns true if the subSystem was found, otherwise returns false\nplayerLoopSystem.TryFindSubSystem\u003cMySystem\u003e(out PlayerLoopSystem system);\nplayerLoopSystem.TryFindSubSystem(out PlayerLoopSystem system, typeof(MySystem));\n\n// Adds a subSystem\nplayerLoopSystem.AddSubSystem(mySystem);\n\n// Creates a new subSystem using passed type and callback and adds it\nplayerLoopSystem.AddSubSystem\u003cMySystem\u003e(Callback);\n\n// Removes all subSystems with passed type\nplayerLoopSystem.RemoveSubSystem\u003cMySystem\u003e();\nplayerLoopSystem.RemoveSubSystem(typeof(MySystem));\n\n// Searches for a subSystem with the passed type and replaces it\nplayerLoopSystem.ReplaceSubSystem\u003cOtherSystem\u003e(mySystem);\nplayerLoopSystem.ReplaceSubSystem(Callback, typeof(OtherSystem));\n```\n\n## Editor mode nuanses\nBy default all the added systems keep working even if you exit play mode. `PlayerLoopBuilder` saves all the systems you add and removes them on play mode exit. If you want to disable this behaviour, while adding a new system pass `false` as a second argument:\n```csharp\n// This subsystem won't be automatically removed\nPlayerLoopBuilder.FromCurrent()\n                 .AddToSubSystem\u003cUpdate\u003e(mySystem, false)\n                 .SetPlayerLoop();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassyasssas%2Fplayerloop-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsassyasssas%2Fplayerloop-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsassyasssas%2Fplayerloop-extension/lists"}