{"id":18824590,"url":"https://github.com/ugnmura/chronity","last_synced_at":"2025-10-12T05:07:56.931Z","repository":{"id":118503019,"uuid":"404969330","full_name":"ugnmura/chronity","owner":"ugnmura","description":":hourglass: Library for running functions after a delay by creating timers in Unity3D.","archived":false,"fork":false,"pushed_at":"2023-07-25T21:51:54.000Z","size":2625,"stargazers_count":56,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T01:36:47.285Z","etag":null,"topics":["csharp","game-development","game-programming","gamedev","openupm","openupm-cli","timer","unity","unity3d"],"latest_commit_sha":null,"homepage":"https://sushiwaumai.github.io/chronity/","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/ugnmura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-09-10T05:42:42.000Z","updated_at":"2024-06-26T07:15:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"1706c6c4-cfd8-4cae-a321-ff33e1d76d75","html_url":"https://github.com/ugnmura/chronity","commit_stats":null,"previous_names":["ugnmura/chronity","sushiwaumai/chronity"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ugnmura/chronity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugnmura%2Fchronity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugnmura%2Fchronity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugnmura%2Fchronity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugnmura%2Fchronity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ugnmura","download_url":"https://codeload.github.com/ugnmura/chronity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ugnmura%2Fchronity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010343,"owners_count":26084738,"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-10-12T02:00:06.719Z","response_time":53,"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":["csharp","game-development","game-programming","gamedev","openupm","openupm-cli","timer","unity","unity3d"],"created_at":"2024-11-08T00:56:52.562Z","updated_at":"2025-10-12T05:07:56.912Z","avatar_url":"https://github.com/ugnmura.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![chronity](./.github/images/Slide.png)](https://sushiwaumai.github.io/Chronity)\n\n[![Release](https://img.shields.io/github/v/release/SushiWaUmai/chronity?include_prereleases\u0026style=flat-square)](https://github.com/SushiWaUmai/Chronity/releases)\n[![OpenUPM](https://img.shields.io/npm/v/com.sushiwaumai.chronity?label=openupm\u0026registry_uri=https://package.openupm.com\u0026style=flat-square)](https://openupm.com/packages/com.sushiwaumai.chronity/)\n[![LISENCE](https://img.shields.io/github/license/SushiWaUmai/chronity?style=flat-square)](https://github.com/SushiWaUmai/Chronity/blob/main/LICENSE)\n[![Compatibility](https://img.shields.io/badge/-2020.3+-11191F?logo=Unity\u0026style=flat-square)](https://unity3d.com/get-unity/download/archive)\n[![GitHub Repo stars](https://img.shields.io/github/stars/SushiWaUmai/chronity?color=%23dca\u0026label=%E2%AD%90\u0026style=flat-square)](https://github.com/SushiWaUmai/Chronity/stargazers)\n\n:hourglass: A library for running functions after a delay in Unity.\n\nThis package is a fork of the [UnityTimer](https://github.com/akbiggs/UnityTimer) made by [akbiggs](https://github.com/akbiggs).\n\nTo get started, read the [docs](https://sushiwaumai.github.io/chronity) or follow this [README](README.md) file.\n\n## Table of Contents\n- [Getting Started](https://github.com/SushiWaUmai/chronity#getting-started-rocket)\n  - [Installation](https://github.com/SushiWaUmai/chronity#installation)\n  - [Quick Start](https://github.com/SushiWaUmai/chronity#quick-start-mortar_board)\n- [Features](https://github.com/SushiWaUmai/chronity#features-sparkles)\n- [License](https://github.com/SushiWaUmai/chronity#license-scroll)\n\n## Getting Started :rocket:\n\n### Installation\nPlease follow the instructions in the manual about [Installing a package from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html). \n\n\nUse the following URL to install the latest version of the package:\nhttps://github.com/SushiWaUmai/chronity.git?path=/com.sushiwaumai.chronity\n\n\n### Quick Start :mortar_board:\n**This is how to call a function after a delay in Chronity.**\n\n```c#\n// Log \"Hello World\" after five seconds.\n\nTimer.Register(5f, () =\u003e Debug.Log(\"Hello World\"));\n```\n\n## Features :sparkles:\n\n**Make a timer repeat by setting `isLooped` to true.**\n```c#\n// Log \"Hello World\" every 10 seconds.\n\nTimer.Register(10f, () =\u003e Debug.Log(\"Hello World\"), isLooped: true);\n```\n\n**Cancel a timer after calling it.**\n```c#\nTimer timer;\n\nprivate void Start()\n{\n    timer = Timer.Register(2f, () =\u003e Debug.Log(\"You won't see this text if you press X.\"));\n}\n\nprivate void Update()\n{\n    if (Input.GetKeyDown(KeyCode.X)) \n    {\n        timer.Cancel();\n    }\n}\n```\n\n\n**Attach the timer to a MonoBehaviour so that the timer is destroyed when the MonoBehaviour is.**\n\nVery often, a timer called from a MonoBehaviour will manipulate that behaviour's state. Thus, it is common practice to cancel the timer in the OnDestroy method of the MonoBehaviour. We've added a convenient extension method that attaches a Timer to a MonoBehaviour such that it will automatically cancel the timer when the MonoBehaviour is detected as null.\n\n```c#\npublic class CoolMonoBehaviour : MonoBehaviour\n{\n    private void Start() \n    {\n        // Use the AttachTimer extension method to create a timer that is destroyed when this\n        // object is destroyed.\n        this.AttachTimer(5f, () =\u003e {\n      \n            // If this code runs after the object is destroyed, a null reference will be thrown,\n            // which could corrupt game state.\n            this.gameObject.transform.position = Vector3.zero;\n        });\n    }\n   \n    private void Update() \n    {\n        // This code could destroy the object at any time!\n        if (Input.GetKeyDown(KeyCode.X)) \n        {\n            GameObject.Destroy(this.gameObject);\n        }\n    }\n}\n```\n\n**Update a value gradually over time using the `onUpdate` callback.**\n\n```c#\n// Change a color from white to red over the course of five seconds.\nColor color = Color.white;\nfloat transitionDuration = 5f;\n\nTimer.Register(transitionDuration,\n   onUpdate: secondsElapsed =\u003e color.r = 255 * (secondsElapsed / transitionDuration),\n   onComplete: () =\u003e Debug.Log(\"Color is now red\"));\n```\n\n**Make a timer presist through scene changes using the `cancelOnSceneChange` parameter.**\n```c#\n// Make a timer that will persist through scene changes.\nTimer.Register(5f, () =\u003e Debug.Log(\"Hello World\"), cancelOnSceneChange: false);\n\n// Change scene from another script \n\n// Logs \"Hello World\" after 5 seconds.\n```\n\n**Make a timer run in the editor by using the `EditorTimer` class.**\n```c#\n// Logs \"Hello World\" after 5 seconds in the editor\n\nEditorTimer.Register(5, () =\u003e Debug.Log(\"Hello World\"));\n```\n\n**A number of other useful features are included!**\n\n- time.Pause()\n- timer.Resume()\n- timer.TimePassed\n- timer.TimeRemaining\n- timer.RatioComplete\n- timer.IsDone\n\n\n## License :scroll:\n\nCode released under [the MIT License](https://github.com/SushiWaUmai/Chronity/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fugnmura%2Fchronity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fugnmura%2Fchronity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fugnmura%2Fchronity/lists"}