当前位置:网站首页>物体上下漂浮工具
物体上下漂浮工具
2022-06-28 02:36:00 【饿掉鱼】
[Header("要移动的物体"), SerializeField]
public GameObject[] go;
[Range(0f, 0.2f)]
[Header("漂浮强度")] public float _floatingspeed = 2f;
[Range(0f, 25f)]
[Header("漂浮轮回时间")] public float _floatingtime = 10f;
private void Update()
{
floating();
}
/// <summary>
/// 漂浮
/// </summary>
/// <param name="_floatingspeed">漂浮速度</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);
}
边栏推荐
- 劲爆!YOLOv6又快又准的目标检测框架开源啦(附源代码下载)
- matlab习题 —— 矩阵的常规运算
- 2022 safety officer-c certificate examination question bank simulated examination platform operation
- GAMES104 作业2-ColorGrading
- 如何给Eclips自动添加作者,时间等…
- Necessary software tools in embedded software development
- 一位博士在华为的22年(干货满满)
- 根据Explain查看sql执行计划,对SQL进行优化
- __ getitem__ And__ setitem__
- WARN:&nbsp;SQL&nbsp;Error:&nbsp;…
猜你喜欢

劲爆!YOLOv6又快又准的目标检测框架开源啦(附源代码下载)

CI & CD 不可不知!

爱普生L3153打印机如何清洗喷头

PPT制作小技巧

The first in the industry! MOS sub evaluation model for subjective video quality experience that can run on mobile devices!

matlab习题 —— 数据的基本处理

Build your own website (17)

【小程序】使用font-awesome字体图标的解决文案(图文)

Brief history and future trend of codeless software

Object class, and__ new__,__ init__,__ setattr__,__ dict__
随机推荐
Flow based depth generation model
TypeError:&nbsp;&#039;module&amp;#03…
collections.defaultdict()的使用
2022电工(初级)复训题库及在线模拟考试
网上股票投资交流群安全吗?进群免费开户靠谱嘛?
Tips for visiting the website: you are not authorized to view the recovery method of this page
RichView TRVStyle TextStyles
Tardigrade:Trino 解决 ETL 场景的方案
国泰君安证券靠谱吗?开证券账户安全吗?
劲爆!YOLOv6又快又准的目标检测框架开源啦(附源代码下载)
Thesis reading: General advantageous transformers
2022年R1快開門式壓力容器操作特種作業證考試題庫及答案
Arm development studio build compilation error
文件的相对路径写法
Win 10出现bitlocke恢复,蓝屏错误代码0x1600007e
用于 C# 的 SQL 基本语法总结
[iptables & ICMP] description of ICMP Protocol in iptables default policy
s32ds跳转到DefaultISR
剑指 Offer 47. 礼物的最大价值(DP)
Simple elk configuration to realize production level log collection and query practice