{"id":19534846,"url":"https://github.com/feifeid47/unity-webimage","last_synced_at":"2025-04-26T14:35:30.262Z","repository":{"id":219548904,"uuid":"749315522","full_name":"feifeid47/Unity-WebImage","owner":"feifeid47","description":"简单易用Unity WebImage，支持异步，支持编辑器右键快捷创建，可自定义实现下载过程","archived":false,"fork":false,"pushed_at":"2024-02-13T06:35:28.000Z","size":646,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-13T07:32:14.341Z","etag":null,"topics":["ugui","unity","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/feifeid47.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-01-28T07:56:47.000Z","updated_at":"2024-01-30T03:51:33.000Z","dependencies_parsed_at":"2024-01-28T09:23:31.005Z","dependency_job_id":"9ff07f7b-9e93-4ba4-ad5b-68eb9de3fe3f","html_url":"https://github.com/feifeid47/Unity-WebImage","commit_stats":null,"previous_names":["feifeid47/unity-webimage"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FUnity-WebImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FUnity-WebImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FUnity-WebImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feifeid47%2FUnity-WebImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feifeid47","download_url":"https://codeload.github.com/feifeid47/Unity-WebImage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224036195,"owners_count":17245035,"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":["ugui","unity","unity3d"],"created_at":"2024-11-11T02:15:53.005Z","updated_at":"2024-11-11T02:15:54.449Z","avatar_url":"https://github.com/feifeid47.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 效果\n\n![](./README/demo1.gif)  \n\n右键快捷创建\n![](./README/demo2.png)  \n\n# 特点\n\n```\n(1) 简单易用\n(2) 支持异步\n(3) 支持编辑器右键快捷创建 \n(4) 可自定义实现下载过程\n```\n\n# 安装\n\n## 方案一\n\n使用git URL\n\n```\nhttps://github.com/feifeid47/Unity-WebImage.git\n```\n\n\n\n![](./README/install.png)  \n\n## 方案二\n\n导入unitypackage\n\n# 如何使用\n\n```C#\nusing Feif.UI;\nusing System.Threading.Tasks;\nusing UnityEngine;\n\npublic class WebImageDemo : MonoBehaviour\n{\n    public WebImage img;\n    public Sprite defaultSprite;\n\n    void Start()\n    {\n        // 设置图片下载器。如果不设置，将会使用默认的图片下载器\n        WebImage.Downloader = WebImageDownloader;\n        // 图片下载成功回调\n        img.OnDownloadSuccess += url =\u003e\n        {\n            Debug.Log(\"下载完成\");\n        };\n        // 图片下载失败回调\n        img.OnDownloadFailed += url =\u003e\n        {\n            Debug.Log(\"下载失败\");\n        };\n        // 设置默认图片，下载失败将使用默认图片\n        img.DefaultSprite = defaultSprite;\n        // 设置图片地址\n        img.SetUrl(\"https://avatars.githubusercontent.com/u/91374196?v=4\");\n    }\n\n    public Task\u003cSprite\u003e WebImageDownloader(string url)\n    {\n        // 在这里实现图片下载的过程\n        // 如果有缓存需求，也是在这里实现\n        return null;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeifeid47%2Funity-webimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeifeid47%2Funity-webimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeifeid47%2Funity-webimage/lists"}