20 lines
502 B
C#
20 lines
502 B
C#
using NaughtyAttributes;
|
|
using UnityEngine;
|
|
|
|
namespace Station46.Modules.Steles.Scripts
|
|
{
|
|
public class AlignStele : MonoBehaviour
|
|
{
|
|
public float speed;
|
|
|
|
[ShowNativeProperty] public float Displacement { get; set; }
|
|
|
|
private void Update()
|
|
{
|
|
var t = transform;
|
|
var position = t.localPosition;
|
|
var delta = position.y - Displacement;
|
|
t.localPosition = new Vector3(0, position.y - delta * speed, 0);
|
|
}
|
|
}
|
|
} |