41 lines
1.7 KiB
C#
41 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
public class FaithEffectTest : MonoBehaviour
|
|
{
|
|
public Transform target;
|
|
public void GenN(int count)
|
|
{
|
|
if (count > 10)
|
|
{
|
|
FindObjectOfType<TopBarUI>().EmitTenthFaith(count/10, target.position);
|
|
}
|
|
else
|
|
{
|
|
FindObjectOfType<TopBarUI>().EmitFaith(count, target.position);
|
|
}
|
|
// for (int i = 0; i < count; i++)
|
|
// {
|
|
// var go = GameObjectPool.Instance.Spawn("ResourceIcon");
|
|
// var IconCanvas = GameObject.Find("Canvas").GetComponent<Canvas>();
|
|
// go.transform.SetParent(IconCanvas.transform);
|
|
// go.transform.position = Camera.main.WorldToScreenPoint(transform.position);
|
|
// var TargetIcon = GameObject.Find("Canvas/TopBar/FaithStatus/FaithCountLabel").GetComponent<TextMeshProUGUI>();
|
|
// // print($"from {go.transform.position} to {TargetIcon.rectTransform.anchoredPosition}");
|
|
//
|
|
// var tweenSequence = DOTween.Sequence();
|
|
// tweenSequence.Append(go.GetComponent<RectTransform>().DOMoveX(TargetIcon.rectTransform.position.x, 0.5f).SetEase(ArrayUtils.UIEasing.RandomPick()));
|
|
// tweenSequence.Join(go.GetComponent<RectTransform>().DOMoveY(TargetIcon.rectTransform.position.y, 0.5f).SetEase(ArrayUtils.UIEasing.RandomPick()));
|
|
// tweenSequence.OnComplete(() =>
|
|
// {
|
|
// go.SetActive(false);
|
|
// // TargetIcon.rectTransform.DOPunchScale(Vector3.one, 0.1f);
|
|
// GameProcedureManager.Instance.FaithCount += 1;
|
|
// });
|
|
// }
|
|
}
|
|
}
|