当前位置:网站首页>Unity WallFxPack使用
Unity WallFxPack使用
2022-08-02 21:43:00 【海涛高软】
默认插件,动画是一开一合,不能单独控制开和合
下面代码,就是可以单独的控制动画的开和关
public class test : MonoBehaviour
{
float time;
bool a = false;
bool b = false;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (a)
{
time += Time.deltaTime*0.8f;
if (time > 1)
{
a = false;
GetComponent<Renderer>().materials[0].SetInt("_SpeedAnimatedMode", 0);
}
}
if (b){
time -= Time.deltaTime;
if (time < 0)
{
b = false;
}
}
GetComponent<Renderer>().materials[0].SetFloat("_WallOpening", time);
if (Input.GetMouseButtonDown(0))
{
kai();
}
if (Input.GetMouseButtonDown(1))
{
guan();
}
}
void kai()
{
a = true;
}
void guan()
{
b = true;
}
}
surf方法中修改如下
float2 temp_output_5_0 = ( ( ( i.uv2_texcoord2 - temp_cast_0 ) * ( 1.0 - pow( (( _AnimatedOpening )?( abs( ( float2( 1,1 ) * _WallOpening) ) ):( temp_cast_1 )) , 0.2 ) ) ) + 0.5 );
FR:徐海涛(hunk Xu)
边栏推荐
- The interviewer asked me: delete library, in addition to run do?
- 采用QT进行OpenGL开发(三)着色器编程
- 增删改查这么多年,最后栽在MySQL的架构设计上!
- 若依如何实现添加水印功能
- 多租户的多种实现方案
- CS5213 chip | HDMI to VGA converter chip data sharing
- golang刷leetcode:统计区间中的整数数目
- apache calcite中关于model文件配置
- Ruoyi integrates minio to realize distributed file storage
- 单例模式你会几种写法?
猜你喜欢
JS Date 时间戳 getTune data.parse 倒计时小程序
Ruoyi integrates minio to realize distributed file storage
The only way to go from a monthly salary of 10k to 30k: automated testing
[c] Detailed explanation of operators (1)
命令行启动常见问题及解决方案
Teach you how to kill if else
抽象工厂模式
【Unity】Unity开发进阶(六)UnityEvent使用与源码解析
【TypeScript】深入学习TypeScript类(下)
[TypeScript] Deep Learning of TypeScript Classes (Part 1)
随机推荐
go context 包
Interviewer: can you talk about optimistic locking and pessimistic locks
golang刷leetcode: 卖木头块
UDP(用户数据报协议)
JS 包装类 Math对象 round max() min() random
word操作:单独调整英文字体
How many ways do you know the singleton pattern?
golang刷leetcode:我能赢吗
golang 刷leetcode:Morris 遍历
主成分分析(PCA)
行业 SaaS 微服务稳定性保障实战
如何抓住NFT、元|宇|宙新趋势?
Abstract Factory Pattern
Add and delete all these years, finally planted in MySQL architecture design!
js function anti-shake and function throttling and other usage scenarios
Learn more TypeScript 】 【 TypeScript modular
CS5213芯片|HDMI to VGA转换头芯片资料分享
无线振弦采集仪远程修改参数的方式
总结嵌入式C语言难点(2部分)
IP协议(网际协议)