设置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;
    }
相关推荐
覆东流14 小时前
Photoshop图形工具组与图层样式
ui·photoshop
集成显卡16 小时前
AI取名大师 | uni-app + Wot UI 跟随设备自动切换明暗主题
人工智能·ui·uni-app·外观配色
测试199817 小时前
如何用Appium实现移动端UI自动化测试?
自动化测试·软件测试·python·测试工具·ui·职场和发展·appium
jf加菲猫18 小时前
第2章 Hello World
开发语言·c++·qt·ui
将编程培养成爱好1 天前
C++ 设计模式《外卖骑手状态系统》
c++·ui·设计模式·状态模式
jf加菲猫2 天前
第1章 认识Qt
开发语言·c++·qt·ui
q***7483 天前
私有化部署DeepSeek并SpringBoot集成使用(附UI界面使用教程-支持语音、图片)
spring boot·后端·ui
paopao_wu3 天前
DeepSeek-OCR实战(03):本地部署+简单UI测试
ui·ocr
lpfasd1233 天前
Valdi:Snapchat 开源的新一代跨平台 UI 框架
ui·开源
九章云极AladdinEdu3 天前
项目分享|告别枯燥命令行,构建终端用户界面的 TypeScript 库
javascript·ui·typescript