This commit is contained in:
2025-09-17 18:56:28 +08:00
commit 54c72710a5
5244 changed files with 5717609 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using UnityEngine;
namespace DestroyIt
{
public class FloatUp : MonoBehaviour
{
[Range(0f, 10f)]
public float floatSpeed = 5f;
private float checkFrequency = 0.05f; // The time (in seconds) this script checks for updates.
private float nextUpdateCheck;
// Use this for initialization
void Start()
{
nextUpdateCheck = Time.time + checkFrequency;
}
// Update is called once per frame
void Update()
{
if (Time.time > nextUpdateCheck)
{
// float up
this.gameObject.transform.position = this.gameObject.transform.position + (Vector3.up * floatSpeed);
// reset the counter
nextUpdateCheck = Time.time + checkFrequency;
}
}
}
}