Files
Hasebe/Assets/Code/OfficeGame/Entities/TestInteractableEntity.cs
T

42 lines
1.3 KiB
C#

using Code.Game.OfficeGame.Text;
using Cysharp.Threading.Tasks;
using Reflex.Attributes;
using TinyGoose.Tremble;
using UnityEngine;
namespace Code.Game.OfficeGame.Entities
{
[PrefabEntity]
public class TestInteractableEntity : InteractableEntity
{
[SerializeField] private string testText = "Interaction";
[SerializeField] private Transform textPosition;
private UniTask _textHandle;
private IAnimatedTextService _animatedTextService;
[Inject]
private void Construct(IAnimatedTextService animatedTextService)
{
_animatedTextService = animatedTextService;
}
public override void Interact()
{
Debug.Log(testText);
if (_textHandle.Status != UniTaskStatus.Pending)
_textHandle = _animatedTextService.CreateAnimatedText(
testText,
1,
1,
3,
Color.mediumAquamarine,
textPosition.position,
textPosition.rotation,
TextAppearType.Pop,
TextDisappearType.Shrink,
behaviourType: TextBehaviourType.RotateHorizontal);
}
}
}