Add utils + refacto

This commit is contained in:
2026-01-30 17:39:26 +01:00
parent 9ff17b5305
commit 23d3cb5d2c
29 changed files with 675 additions and 461 deletions
@@ -1,5 +1,6 @@
using UnityEngine;
using Unheimlich.Interactions.Core;
using Unheimlich.Utility;
namespace Unheimlich.Gameplay.Environment
{
@@ -29,21 +30,17 @@ namespace Unheimlich.Gameplay.Environment
public void ToggleDoor()
{
LeanTween.cancel(gameObject);
gameObject.CancelAllTweens();
if (!IsOpen)
{
LeanTween.rotate(gameObject, _openRotation.eulerAngles, _animationDuration)
.setEase(_easeType);
TweenHelper.RotateLocal(gameObject, _openRotation.eulerAngles, _animationDuration, null, _easeType);
IsOpen = true;
InteractionText = "Close";
}
else
{
LeanTween.rotate(gameObject, _closedRotation.eulerAngles, _animationDuration)
.setEase(_easeType);
TweenHelper.RotateLocal(gameObject, _closedRotation.eulerAngles, _animationDuration, null, _easeType);
IsOpen = false;
InteractionText = "Open";
}