设置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;
    }
相关推荐
铭毅天下41 分钟前
Easysearch UI vs Kibana——可视化工具选型指南
ui
航Hang*2 小时前
Photoshop 图形与图像处理技术——第5章:路径与形状的应用
图像处理·笔记·ui·photoshop
航Hang*14 小时前
Photoshop 图形与图像处理技术——第1章:数字图像基本知识
图像处理·笔记·ui·photoshop
长空任鸟飞_阿康17 小时前
MasterGo AI 实战教程:10分钟生成网页设计图(附案例演示)
前端·人工智能·ui·ai
Xiaobaiforgod1 天前
产品 & UI/UX
ui·产品经理·ux
航Hang*1 天前
Photoshop 图形与图像处理技术——第3章:图像的选择与填充
图像处理·笔记·ui·photoshop
l1m0_1 天前
UI设计规范工程化,AI生成Ant Design设计稿流程拆解
人工智能·ui·产品经理·设计·arco design·设计规范
航Hang*1 天前
Photoshop 图形与图像处理技术——第4章:图层的应用
图像处理·笔记·ui·photoshop
航Hang*1 天前
Photoshop 图形与图像处理技术——第2章:图像处理基础
图像处理·笔记·ui·组合模式·photoshop