{"id":13663508,"url":"https://github.com/5u4/unity-health-bar","last_synced_at":"2025-04-25T17:31:13.226Z","repository":{"id":135601009,"uuid":"157643025","full_name":"5u4/unity-health-bar","owner":"5u4","description":"💕 A cool interactive unity health bar","archived":true,"fork":false,"pushed_at":"2018-11-15T23:06:31.000Z","size":1664,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-03T05:18:33.851Z","etag":null,"topics":["health-bar","module","package","unity"],"latest_commit_sha":null,"homepage":"http://u3d.as/1nts","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/5u4.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}},"created_at":"2018-11-15T02:52:51.000Z","updated_at":"2023-01-28T13:19:16.000Z","dependencies_parsed_at":"2023-06-07T02:00:16.501Z","dependency_job_id":null,"html_url":"https://github.com/5u4/unity-health-bar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5u4%2Funity-health-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5u4%2Funity-health-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5u4%2Funity-health-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5u4%2Funity-health-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5u4","download_url":"https://codeload.github.com/5u4/unity-health-bar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224011454,"owners_count":17240938,"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":["health-bar","module","package","unity"],"created_at":"2024-08-02T05:02:29.185Z","updated_at":"2024-11-10T20:30:42.722Z","avatar_url":"https://github.com/5u4.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"img/large.png\" width=\"60%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/senhungwong/unity-health-bar/blob/master/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/senhungwong/unity-health-bar.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/senhungwong/unity-health-bar/tags\"\u003e\u003cimg alt=\"GitHub tag\" src=\"https://img.shields.io/github/tag/senhungwong/unity-health-bar.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"http://u3d.as/1nts\"\u003e\u003cimg alt=\"Unity Assets Store\" src=\"https://img.shields.io/badge/store-unity assets store-ff69b4.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Description\n\nA prefab that shows a character's health.\n\n## Demo\n\n![](img/demo.gif)\n\n## How to use\n\n1. Drag the prefab into the `Hierarchy`.\n\n2. Make sure an `EventSystem` exists in the `Hierarchy`. (If not, you can create one by creating a `canvas` element then delete it)\n\n3. Set health\n\n```cs\npublic float maxHealth;\npublic float currentHealth;\n\npublic HealthBar healthBar;\n\nprivate void Start() {\n    healthBar.SetMaxHealth(maxHealth);\n    healthBar.SetCurrentHealth(currentHealth);\n}\n```\n\n4. Update current health when damaged or healed\n\n```cs\ncurrentHealth -= damage;\nhealthBar.SetCurrentHealth(currentHealth);\n```\n\n## Video\n\n```\n// TODO: Add a tutorial video while there are plenty enough types of health bars\n```\n\n## Unity assets store\n\nhttp://u3d.as/1nts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5u4%2Funity-health-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5u4%2Funity-health-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5u4%2Funity-health-bar/lists"}