smart-interactive-display/Assets/GadGame/Scripts/PassByAnimation.cs

31 lines
898 B
C#
Raw Normal View History

2024-04-22 02:10:49 -07:00
using DG.Tweening;
using GadGame.Network;
using GadGame.Singleton;
2024-04-23 02:44:22 -07:00
using Microsoft.Unity.VisualStudio.Editor;
2024-04-22 02:10:49 -07:00
using Sirenix.OdinInspector;
2024-04-23 02:44:22 -07:00
using TMPro;
2024-04-22 02:10:49 -07:00
using UnityEngine;
2024-04-23 02:44:22 -07:00
using UnityEngine.UI;
2024-04-22 02:10:49 -07:00
namespace GadGame.State.MainFlowState
{
public class PassByAnimation : Singleton<PassByAnimation>
{
public Animator passBy;
[SerializeField] private RectTransform _transform;
2024-04-23 02:44:22 -07:00
[SerializeField] private UnityEngine.UI.Image CircleImg;
[SerializeField] private TextMeshProUGUI txtProgress;
// [SerializeField] [Range(0,1)] float progress = 1f;
2024-04-22 02:10:49 -07:00
[Button]
public void Play(bool engage) {
_transform.DOAnchorPosX(engage ? -1000 : 0, 2);
}
2024-04-23 02:44:22 -07:00
public void ReadyCountDown(float progress){
CircleImg.fillAmount = progress ;
txtProgress.text = Mathf.Floor(progress * 3).ToString();
}
2024-04-22 02:10:49 -07:00
}
}