当前位置:网站首页>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)
边栏推荐
猜你喜欢
随机推荐
在迁移测试中,源表、中间表、目标表的迁移规则
圆锥折射作为偏振计量工具的模拟
工厂模式理解了没有?
管理工具|宝藏书签收藏管理工具
Auto.js脚本程序打包
宝塔搭建实测-基于ThinkPHP5.1的wms进销存源码
I interviewed a 985 graduate, and I will never forget the expression when answering the "performance tuning" question
go 序列化与反序列化
golang 刷leetcode:从栈中取出 K 个硬币的最大面值和
【干货】分库分表最佳实践
SSM整合步骤(重点)
js函数防抖和函数节流及其他使用场景
H5网页播放器EasyPlayer.js播放器界面的加载效果无法消失是什么原因?
golang 刷leetcode:将字符串翻转到单调递增
How to seize the new trend of NFT, yuan|universe|universe?
源码构建LAMP环境-2
从零开始配置 vim(5)——本地设置与全局设置
Word operation: adjust the English font individually
The interviewer asked me: delete library, in addition to run do?
手把手教你干掉if else








