{"id":14964068,"url":"https://github.com/alexixrugis/unitystatemachines","last_synced_at":"2026-02-08T11:37:08.308Z","repository":{"id":186699735,"uuid":"675603229","full_name":"AlexixRugis/UnityStateMachines","owner":"AlexixRugis","description":"State machine library for Unity","archived":false,"fork":false,"pushed_at":"2023-08-07T10:01:17.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T21:57:17.483Z","etag":null,"topics":["unity","unity2d","unity3d","unity3d-plugin"],"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/AlexixRugis.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-08-07T09:52:26.000Z","updated_at":"2024-01-02T21:38:10.000Z","dependencies_parsed_at":"2023-12-10T20:15:10.960Z","dependency_job_id":null,"html_url":"https://github.com/AlexixRugis/UnityStateMachines","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"3aa212093a32e764d7e2b6419250ed4951a4078f"},"previous_names":["alexixrugis/unitystatemachines"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AlexixRugis/UnityStateMachines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexixRugis%2FUnityStateMachines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexixRugis%2FUnityStateMachines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexixRugis%2FUnityStateMachines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexixRugis%2FUnityStateMachines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexixRugis","download_url":"https://codeload.github.com/AlexixRugis/UnityStateMachines/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexixRugis%2FUnityStateMachines/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267808118,"owners_count":24147355,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"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":["unity","unity2d","unity3d","unity3d-plugin"],"created_at":"2024-09-24T13:32:32.422Z","updated_at":"2026-02-08T11:37:08.265Z","avatar_url":"https://github.com/AlexixRugis.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example of a finite state machine\n```C#\npublic class TestStateMachine : StateMachineBehavior\n    {\n        private class FooState : BaseState\n        {\n            // Called at the time of state registration in the state machine\n            public override void OnRegistered(StateMachineBehavior stateMachine)\n            {\n                base.OnRegistered(stateMachine);\n                Debug.Log($\"Foo registered in {stateMachine}\");\n            }\n\n            // Called when the state machine enters this state\n            public override void OnEnter()\n            {\n                base.OnEnter();\n                Debug.Log(\"Foo entered\");\n            }\n\n            // Called when the state machine exits this state\n            public override void OnExit()\n            {\n                base.OnExit();\n                Debug.Log(\"Foo exited\");\n            }\n\n            // Called every frame when the state machine updates the state\n            public override void OnUpdate()\n            {\n                base.OnUpdate();\n                Debug.Log(\"Foo ticked\");\n\n                if (Input.GetKeyDown(KeyCode.Q)) TransitTo\u003cBarState\u003e();\n            }\n\n            // Called when the state machine is paused with this state or before exiting the state\n            public override void OnPause()\n            {\n                base.OnPause();\n                Debug.Log(\"Foo paused\");\n            }\n\n            // Called when the state machine is paused with this state or after entering the state\n            public override void OnResume()\n            {\n                base.OnPause();\n                Debug.Log(\"Foo resumed\");\n            }\n        }\n\n        private class BarState : BaseState\n        {\n            public override void OnRegistered(StateMachineBehavior stateMachine)\n            {\n                base.OnRegistered(stateMachine);\n                Debug.Log($\"Bar registered in {stateMachine}\");\n            }\n\n            public override void OnEnter()\n            {\n                base.OnEnter();\n                Debug.Log(\"Bar entered\");\n            }\n\n            public override void OnExit()\n            {\n                base.OnExit();\n                Debug.Log(\"Bar exited\");\n            }\n\n            public override void OnUpdate()\n            {\n                base.OnUpdate();\n                Debug.Log(\"Bar ticked\");\n\n                if (Input.GetKeyDown(KeyCode.W)) TransitTo\u003cFooState\u003e();\n            }\n\n            public override void OnPause()\n            {\n                base.OnPause();\n                Debug.Log(\"Bar paused\");\n            }\n\n            public override void OnResume()\n            {\n                base.OnPause();\n                Debug.Log(\"Bar resumed\");\n            }\n        }\n\n        // The state that the state machine enters at the beginning\n        protected override Type InitialState =\u003e typeof(FooState);\n\n        // State registration in a finite state machine\n        protected override void RegisterStates()\n        {\n            RegisterState(new FooState());\n            RegisterState(new BarState());\n        }\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexixrugis%2Funitystatemachines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexixrugis%2Funitystatemachines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexixrugis%2Funitystatemachines/lists"}