55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using Sirenix.OdinInspector;
|
|
using TMPro;
|
|
using UniRx;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.Editor
|
|
{
|
|
public class TimePointer : MonoBehaviour
|
|
{
|
|
public TMP_Text intervalUnitText;
|
|
public float time;
|
|
public int index;
|
|
public bool isInScreen
|
|
{
|
|
get => _isInScreen;
|
|
set
|
|
{
|
|
_isInScreen = value;
|
|
if (_isInScreen)
|
|
{
|
|
transform.localScale = Vector3.one;
|
|
}
|
|
else
|
|
{
|
|
transform.localScale = Vector3.zero;
|
|
}
|
|
}
|
|
}
|
|
private bool _isInScreen = false;
|
|
|
|
// [Title("poss")]
|
|
// public Vector3 position;
|
|
// public Vector3 localPosition;
|
|
// public Vector3 anchoredPosition;
|
|
// public Vector3 anchoredPosition3D;
|
|
// public void Update()
|
|
// {
|
|
// position = this.transform.position;
|
|
// localPosition = this.transform.localPosition;
|
|
// anchoredPosition = this.GetComponent<RectTransform>().anchoredPosition;
|
|
// anchoredPosition3D = this.GetComponent<RectTransform>().anchoredPosition3D;
|
|
// }
|
|
public void PlayAnim()
|
|
{
|
|
intervalUnitText.transform.DOKill();
|
|
intervalUnitText.transform.DOScale(Vector3.one * 1.5f, 0.1f).SetEase(Ease.OutCubic).OnComplete(() =>
|
|
{
|
|
intervalUnitText.transform.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutCubic);
|
|
});
|
|
}
|
|
}
|
|
} |