{"id":16203687,"url":"https://github.com/setchi/ugui-hypertext","last_synced_at":"2026-03-16T12:32:52.770Z","repository":{"id":85639097,"uuid":"64594758","full_name":"setchi/uGUI-Hypertext","owner":"setchi","description":"Hypertext for uGUI","archived":false,"fork":false,"pushed_at":"2019-11-29T14:10:10.000Z","size":99,"stargazers_count":155,"open_issues_count":0,"forks_count":36,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-16T01:41:20.692Z","etag":null,"topics":["csharp","hypertext","ugui","unity","unity3d"],"latest_commit_sha":null,"homepage":"http://setchi.hatenablog.com/entry/2016/07/31/234204","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/setchi.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}},"created_at":"2016-07-31T13:18:23.000Z","updated_at":"2025-03-11T12:41:23.000Z","dependencies_parsed_at":"2023-03-10T03:46:09.861Z","dependency_job_id":null,"html_url":"https://github.com/setchi/uGUI-Hypertext","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/setchi%2FuGUI-Hypertext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/setchi%2FuGUI-Hypertext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/setchi%2FuGUI-Hypertext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/setchi%2FuGUI-Hypertext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/setchi","download_url":"https://codeload.github.com/setchi/uGUI-Hypertext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858891,"owners_count":20359257,"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","hypertext","ugui","unity","unity3d"],"created_at":"2024-10-10T09:54:49.922Z","updated_at":"2026-03-16T12:32:52.700Z","avatar_url":"https://github.com/setchi.png","language":"C#","readme":"# uGUI-Hypertext [![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/setchi/uGUI-Hypertext/blob/master/LICENSE) [![Release](https://img.shields.io/github/release/setchi/uGUI-Hypertext.svg?style=flat-square\u0026logo=github)](https://github.com/setchi/uGUI-Hypertext/releases/latest)\n\n`UnityEngine.UI.Text` で任意の部分文字列をクリック可能にするコンポーネントです。[English](https://translate.google.com/translate?sl=ja\u0026tl=en\u0026u=https://github.com/setchi/uGUI-Hypertext) (by Google Translate)\n\n![screencast](screencast.gif)\n\n```csharp\npublic class RegexExample : MonoBehaviour\n{\n    [SerializeField] RegexHypertext text = default;\n\n    const string RegexUrl = @\"https?://(?:[!-~]+\\.)+[!-~]+\";\n    const string RegexHashtag = @\"[\\s^][#＃]\\w+\";\n\n    void Start()\n    {\n        text.OnClick(RegexUrl, Color.cyan, url =\u003e Debug.Log(url));\n        text.OnClick(RegexHashtag, Color.green, hashtag =\u003e Debug.Log(hashtag));\n    }\n}\n```\n\n## 導入\n[Releases](https://github.com/setchi/uGUI-Hypertext/releases/latest) から `Hypertext.unitypackage` をダウンロードして Unity Project にインポートします。\n\n## サンプル\n[Hypertext/Examples](Assets/Hypertext/Examples/) に正規表現によるパターンマッチで任意の部分文字列をクリック可能にする実装例があるので参考にしてください。\n\n## 使い方\n[HypertextBase](Assets/Hypertext/Scripts/HypertextBase.cs) を継承したクラスを作成し、`OnClick` メソッドを使って任意の部分文字列がクリックされた時のコールバックを登録できます。詳細はサンプルの [RegexHypertext](Assets/Hypertext/Examples/RegexHypertext.cs) を参考にしてください。\n\n```csharp\n/// \u003csummary\u003e\n/// 指定した部分文字列にクリックイベントを登録します\n/// \u003c/summary\u003e\n/// \u003cparam name=\"startIndex\"\u003e部分文字列の開始文字位置\u003c/param\u003e\n/// \u003cparam name=\"length\"\u003e部分文字列の長さ\u003c/param\u003e\n/// \u003cparam name=\"color\"\u003e部分文字列につける色\u003c/param\u003e\n/// \u003cparam name=\"onClick\"\u003e部分文字列がクリックされたときのコールバック\u003c/param\u003e\nprotected void OnClick(int startIndex, int length, Color color, Action\u003cstring\u003e onClick)\n```\n\n## 開発環境\nUnity 2019.2.10f1\n\n## Author\n[setchi](https://github.com/setchi)\n\n## License\n[MIT](https://github.com/setchi/uGUI-Hypertext/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetchi%2Fugui-hypertext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsetchi%2Fugui-hypertext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsetchi%2Fugui-hypertext/lists"}