Add utils + refacto
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user