当前位置:网站首页>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);
}
边栏推荐
- 剑指 Offer 53 - I. 在排序数组中查找数字 I(改进二分)
- Notepad++--常用的插件
- Severe Tire Damage:世界上第一个在互联网上直播的摇滚乐队
- 华为设备WLAN基本业务配置命令
- 开口式霍尔电流传感器如何助力直流配电改造?
- Is it better for a novice to open a securities account? Is it safe to open a stock trading account
- 2022 safety officer-c certificate examination question bank simulated examination platform operation
- Go 数据类型篇(四)之浮点型与复数类型
- What is the best and safest software to download when buying stocks?
- 云应用、服务的“5层”架构
猜你喜欢
Set drop-down options on Excel files
What are the technologies to be mastered in the test? Database design for software testing
可扩展数据库(上)
Build your own website (17)
What is the core problem to be solved in the East and West?
栈的基本操作(C语言实现)
導入Excel文件,解决跳過空白單元格不讀取,並且下標前移的問題,以及RETURN_BLANK_AS_NULL報紅
composition api在项目中的使用总结
Brief history and future trend of codeless software
剑指 Offer 47. 礼物的最大价值(DP)
随机推荐
Go 数据类型篇(四)之浮点型与复数类型
In the digital era, enterprises must do well in user information security
【PaddleDetection】ModuleNotFoundError: No module named ‘paddle‘
Anaconda命令用法
crond BAD FILE MODE /etc/cron.d
建立自己的网站(17)
为什么OpenCV计算的帧率是错误的?
《Go题库·12》slice和array区别?
TypeScript 联合类型
调试利器 go-spew
How to write concise code? (upper)
Tardigrade:Trino 解决 ETL 场景的方案
第九章 APP项目测试(3) 测试工具
可扩展数据库(上)
文档问题
"9 No" principle and "5 measurement dimensions" of extensible system
力扣每日一题-第29天-575.分糖果
How to automatically add author, time, etc. to eclipse
数据库系列之MySQL中的执行计划
Ten reasons for system performance failure