设置HP条UI

概述

设置常见的生命值条,

实现过程

设置UI/image作为形状

设置UI/Image作为背景

设置UI/image(healthfill)作为填充图片,层数低于背景

设置heathfill的imagetype为filled

fillmethod为horizontal

csharp 复制代码
 [SerializeField] private Image healthFill;
 public void AddHealth(int healAmount)
    {
        health += healAmount;
        if (health > maxHealth)
            health = maxHealth;
        healthFill.fillAmount = health / maxHealth;
    }
相关推荐
for_ever_love__5 小时前
UI学习:UISearchController基础了解和应用
学习·ui·ios·objective-c
ZC跨境爬虫6 小时前
跟着 MDN 学CSS day_39:(Flexbox 弹性盒子核心机制)
前端·css·ui·html·tensorflow
海兰10 小时前
【文字三国志:第六篇】天命重构,UI组件设计细节
人工智能·ui·语言模型·小程序
EMTime12 小时前
玲珑GUI-工程设置
单片机·mcu·ui·用户界面
小拉达不是臭老鼠14 小时前
Unity中的UI系统之UGUI
学习·ui·unity
秋雨梧桐叶落莳19 小时前
iOS——抽屉视图详解
开发语言·macos·ui·ios·objective-c·cocoa
小拉达不是臭老鼠20 小时前
Unity中的UI系统之UGUI_登陆面板实现
ui·unity
许彰午2 天前
状态模式实战——Row对象的状态机
java·ui·状态模式
zhbi982 天前
LVGL8.3标签Label高级应用
ui·lvgl
像风一样的男人@2 天前
warning: could not find UI helper ‘git-credential-manager-ui‘
git·ui