设置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;
    }
相关推荐
wtsolutions2 小时前
Using the Excel to JSON API - Programmatic Access for Developers
ui·json·xhtml
weixin_4024863413 小时前
在adobe illustrator 上写latex code 显示数学公式 安装 LaTeX2Illustrator
ui·adobe·illustrator
航Hang*1 天前
Photoshop 图形与图像处理技术——第9章:实践训练2——变换花朵颜色与绘制正方体
图像处理·笔记·学习·ui·photoshop·期末·复习
航Hang*1 天前
Photoshop 图形与图像处理技术——第9章:实践训练5——文字和路径
图像处理·笔记·学习·ui·photoshop·期末
工业HMI实战笔记1 天前
HMI权限分级设计:兼顾安全与操作效率的平衡术
运维·数据库·安全·ui·自动化·人机交互·交互
世人万千丶1 天前
鸿蒙跨端框架 Flutter 学习 Day 4:网络交互——HTTP 请求基础与数据反序列化实战
网络·学习·flutter·ui·交互·harmonyos·鸿蒙
航Hang*2 天前
Photoshop 图形与图像处理技术——第9章:实践训练6——滤镜特效
图像处理·笔记·学习·ui·photoshop
小雨下雨的雨2 天前
鸿蒙PC应用:工程结构解析与配置文件详解
ui·华为·harmonyos·鸿蒙系统
世人万千丶2 天前
鸿蒙跨端框架 Flutter 学习 Day 3:性能进阶——Iterable 延迟加载与计算流的智慧
学习·flutter·ui·华为·harmonyos·鸿蒙·鸿蒙系统