[Fix] All in one + add dice

This commit is contained in:
2026-02-23 22:24:46 +07:00
parent 4f942cd7c0
commit 2f9e082d75
1593 changed files with 474068 additions and 31 deletions
@@ -0,0 +1,42 @@
using System;
using UnityEngine;
namespace AllIn13DShader
{
public class SinVerticalPositionTween : MonoBehaviour
{
private float timer;
public float speed = 5;
public float minY = -1;
public float maxY = 1;
public Transform target;
private void OnEnable()
{
timer = 0f;
}
private void OnDisable()
{
timer = 0f;
}
public void Update()
{
timer += Time.deltaTime;
float sin01 = (Mathf.Sin(timer * speed) + 1f) * 0.5f;
Vector3 localPos = target.localPosition;
localPos.y = Mathf.Lerp(minY, maxY, sin01);
target.localPosition = localPos;
}
private void Reset()
{
if(target == null) target = transform;
}
}
}