最近项目有一个需求: 用图片实现桶中的水涨效果
效果如下:
找不到好的贴图,效果比较丑,请见谅! 哈哈!
思路: 修改贴图的像素值,具体做法见代码
using DG.Tweening;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 利用像素来实现波动效果
/// SetPixels32 function works only on RGBA32, ARGB32, RGB24 and Alpha8 texture formats. For other formats SetPixels is ignored.
/// The texture also has to have Is Readable flag set in the import settings.