2026-03-20 11:56:50 -04:00
|
|
|
|
using UnityEngine;
|
2025-10-03 00:02:43 -04:00
|
|
|
|
|
|
|
|
|
|
public class DNP_UIMove : MonoBehaviour
|
|
|
|
|
|
{
|
|
|
|
|
|
public Vector2 fromPosition;
|
|
|
|
|
|
public Vector2 toPosition;
|
|
|
|
|
|
public float frequency = 4f;
|
|
|
|
|
|
|
2026-03-20 11:56:50 -04:00
|
|
|
|
private RectTransform rectTransform;
|
2025-10-03 00:02:43 -04:00
|
|
|
|
|
2026-03-20 11:56:50 -04:00
|
|
|
|
private void Start()
|
2025-10-03 00:02:43 -04:00
|
|
|
|
{
|
|
|
|
|
|
rectTransform = GetComponent<RectTransform>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-20 11:56:50 -04:00
|
|
|
|
private void FixedUpdate()
|
2025-10-03 00:02:43 -04:00
|
|
|
|
{
|
2026-03-20 11:56:50 -04:00
|
|
|
|
rectTransform.anchoredPosition =
|
|
|
|
|
|
Vector2.Lerp(fromPosition, toPosition, Mathf.Sin(Time.time * frequency) * 0.5f + 0.5f);
|
2025-10-03 00:02:43 -04:00
|
|
|
|
}
|
2026-03-20 11:56:50 -04:00
|
|
|
|
}
|