Advanced POC - portals, dialogue system + floating words, room loading

This commit is contained in:
2026-01-26 20:31:27 +01:00
parent b5ca4763b3
commit 203b00578a
426 changed files with 123482 additions and 29 deletions
@@ -0,0 +1,52 @@
using UnityEngine;
using Unheimlich.Interactions.Core;
namespace Unheimlich.Gameplay.Environment
{
public class DoorInteractable : InteractableBase
{
[Header("Door Settings")]
public bool IsOpen = false;
[SerializeField] private float _openAngle = 90f;
[SerializeField] private float _animationDuration = 0.5f;
[SerializeField] private LeanTweenType _easeType = LeanTweenType.easeInOutQuad;
private Quaternion _closedRotation;
private Quaternion _openRotation;
protected virtual void Start()
{
_closedRotation = transform.rotation;
_openRotation = _closedRotation * Quaternion.Euler(0, _openAngle, 0);
InteractionText = IsOpen ? "Close" : "Open";
}
public override void Interact(GameObject interactor)
{
ToggleDoor();
}
public void ToggleDoor()
{
LeanTween.cancel(gameObject);
if (!IsOpen)
{
LeanTween.rotate(gameObject, _openRotation.eulerAngles, _animationDuration)
.setEase(_easeType);
IsOpen = true;
InteractionText = "Close";
}
else
{
LeanTween.rotate(gameObject, _closedRotation.eulerAngles, _animationDuration)
.setEase(_easeType);
IsOpen = false;
InteractionText = "Open";
}
}
}
}