设置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;
    }
相关推荐
Devlab4 小时前
LVGL设计大师——网页版anyui来了!!
嵌入式硬件·物联网·低代码·ui·iot
向星而行_star16 小时前
Ito 模型在业务场景中的落地应用指南
ui
界面开发小八哥17 小时前
界面控件DevExpress XAF v26.1新版亮点——Blazor UI功能增强(二)
ui·界面控件·blazor·devexpress·ui开发
Oll Correct18 小时前
Adobe illustrator 案例四:吃豆人 (Pac-Man)图标绘制
笔记·ui·adobe·illustrator
阿图灵1 天前
Agentic AI 架构入门(九):Agent 通信协议全景——ACP/A2A/AG-UI/MCP
人工智能·ui·架构·ai agent·智能体·mcp·agentic ai
AI分享猿2 天前
UI设计Prompt系列(十二):设计系统入门——把视觉语言沉淀为可复用规范
ui·prompt
l1m0_2 天前
告别反复修改Prompt:AI生成React应用并落地开发的实战复盘
前端·react.js·ui·ai·设计
大千UI工场2 天前
时序数据库对数字孪生的作用
数据库·ui·时序数据库·前端开发·b端管理系统
UnicornIT2 天前
【HarmonyOS】时间管理类APP:做成“自适应“
ui·华为·harmonyos·鸿蒙
AI分享猿3 天前
UI设计Prompt系列(六):原型验证提速——用设计Prompt跳过反复改稿
ui·prompt