当前位置:网站首页>Object floating tool
Object floating tool
2022-06-28 03:35:00 【Starve fish】
[Header(" The object to be moved "), SerializeField]
public GameObject[] go;
[Range(0f, 0.2f)]
[Header(" Floating strength ")] public float _floatingspeed = 2f;
[Range(0f, 25f)]
[Header(" Floating cycle time ")] public float _floatingtime = 10f;
private void Update()
{
floating();
}
/// <summary>
/// floating
/// </summary>
/// <param name="_floatingspeed"> Floating speed </param>
public void floating()
{
if (Time.time % _floatingtime > _floatingtime/2)
for (int i = 0; i < go.Length; i++)
go[i].transform.position += new Vector3(0, _floatingspeed, 0);
else
for (int i = 0; i < go.Length; i++)
go[i].transform.position -= new Vector3(0, _floatingspeed, 0);
}
边栏推荐
- Use js programming questions [split] in Niuke
- 可扩展数据库(下)
- What are the good practices of cloud cost optimization?
- ARM Development Studio build编译报错
- 2022安全员-C证考试题库模拟考试平台操作
- Dataloader参数collate_fn的使用
- 音视频技术开发周刊 | 251
- Brief history and future trend of codeless software
- Notepad++--常用的插件
- nn. Parameter and torch nn. Init series of functions to initialize model parameters
猜你喜欢
R1 Quick Open Pressure Vessel Operation Special Operation Certificate Examination Library and Answers in 2022
为什么OpenCV计算的帧率是错误的?
数据库系列之MySQL中的执行计划
collections.defaultdict()的使用
「运维有小邓」监控文件及文件夹变更
【PaddleDetection】ModuleNotFoundError: No module named ‘paddle‘
数据库系列之MySQL中的分页查询优化
Is your IOT security strong enough?
用于 C# 的 SQL 基本语法总结
Object类,以及__new__,__init__,__setattr__,__dict__
随机推荐
Go 数据类型篇(四)之浮点型与复数类型
启牛开的证券账户是安全的吗?如何开账户呢
JS clear the object and its value:
《Go题库·12》slice和array区别?
力扣每日一题-第29天-523.在区间范围统计奇数数目
A16z: metauniverse unlocks new opportunities in game infrastructure
TypeError:&nbsp;&#039;module&amp;#03…
INFO:&nbsp;HHH000397:&nbsp;Using…
Use js programming questions [split] in Niuke
十年职场软件工程师感悟
nn. Parameter and torch nn. Init series of functions to initialize model parameters
STM32外设SDIO和SD卡的配置
开口式霍尔电流传感器如何助力直流配电改造?
MySQL错误
2022年R1快開門式壓力容器操作特種作業證考試題庫及答案
nn.Parameter和torch.nn.init系列函数给模型参数初始化
数据库的迁移
What are the good practices of cloud cost optimization?
View the SQL execution plan according to explain and optimize the SQL
用于 C# 的 SQL 基本语法总结