chore: Project Restructuring & Theatre
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Unheimlich.Features.Player
|
||||
{
|
||||
public class HandTouchFeedback : MonoBehaviour
|
||||
{
|
||||
[Header("Visual Settings")]
|
||||
[SerializeField] private Image _feedbackImage;
|
||||
[SerializeField] private Color _readyColor = Color.green;
|
||||
[SerializeField] private float _pulseSpeed = 2f;
|
||||
[SerializeField] private float _pulseIntensity = 0.3f;
|
||||
|
||||
private float _pulseTimer;
|
||||
private Color _originalColor;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_feedbackImage != null)
|
||||
{
|
||||
_originalColor = _feedbackImage.color;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_pulseTimer = 0f;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_feedbackImage == null)
|
||||
return;
|
||||
|
||||
_pulseTimer += Time.deltaTime * _pulseSpeed;
|
||||
float pulse = (Mathf.Sin(_pulseTimer) + 1f) * 0.5f;
|
||||
|
||||
Color targetColor = Color.Lerp(_originalColor, _readyColor, pulse * _pulseIntensity);
|
||||
_feedbackImage.color = targetColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user