test commit

This commit is contained in:
niko
2026-10-11 20:26:48 +02:00
parent 4dbd3c0ab3
commit 6fee00e7ff
2187 changed files with 760371 additions and 2 deletions
+37
View File
@@ -0,0 +1,37 @@
using TMPro;
using UnityEngine;
public class PopUp : MonoBehaviour
{
public TMP_Text Text;
public float DestroyTime = 5;
float timeSinceCreation;
Vector3 offset;
bool dropDown;
private void Start()
{
timeSinceCreation = Time.time;
offset.y = -100;
}
private void Update()
{
if (!Player.Instance) return;
if (dropDown)
offset.y = Mathf.Lerp(offset.y, -100, Time.deltaTime / 2f);
else
offset.y = Mathf.Lerp(offset.y, 0, Time.deltaTime * 5f);
this.transform.position = Vector3.Lerp(this.transform.position, Player.Instance.Camera.transform.position + (Player.Instance.Camera.transform.forward * 5) + offset, Time.deltaTime * 10f);
this.transform.rotation = Quaternion.Lerp(this.transform.rotation, Player.Instance.Camera.transform.rotation, Time.deltaTime * 10f);
if (Time.time > timeSinceCreation + (DestroyTime - 1))
dropDown = true;
if (Time.time > timeSinceCreation + DestroyTime)
Destroy(this.gameObject);
}
}