Kastell/Assets/Scripts/CameraHeight.cs
Gerard Gascón f5c1616018 init
2025-02-02 23:45:04 +01:00

19 lines
No EOL
347 B
C#

using System;
using DG.Tweening;
using UnityEngine;
public class CameraHeight : MonoBehaviour {
private float _currentHeight;
private void Start() {
SetHeight(0f);
}
public void SetHeight(float height) {
if (height <= _currentHeight)
return;
_currentHeight = height;
transform.DOMoveY(height, 1f).SetEase(Ease.OutCubic);
}
}