21 lines
543 B
C#
21 lines
543 B
C#
using UnityEngine;
|
|
|
|
public class SinWave : MonoBehaviour
|
|
{
|
|
public float sinMultiplier = 1f;
|
|
public float sinSpeed = 1f;
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
Vector3 currentLocation = gameObject.transform.position;
|
|
currentLocation.y += Mathf.Sin(Time.deltaTime * sinSpeed) * sinMultiplier;
|
|
gameObject.transform.position = currentLocation;
|
|
}
|
|
}
|