C#/문제해결

0906 DoTween

버스창문 2022. 9. 6. 10:51
    public void Blink(TMP_Text a)
    {
            a.DOFade(0, 1).OnComplete( () => {
                a.DOFade(1, 1).OnComplete(()=> { this.Blink(a); });
            });
    }

onComplete로 쓰면 대리자가 전달이 안되고, 반드시 OnComplete로 써야한다.

대체 왜 저렇게 만들었을까

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using DG.Tweening;
using TMPro;

public class App : MonoBehaviour
{
    public static App instance;
    // Start is called before the first frame update
    void Start()
    {
        instance = this;
        DontDestroyOnLoad(this.gameObject);
        SceneManager.LoadScene("Title");
    }

    public void Blink(TMP_Text a)
    {
            a.DOFade(0, 1).OnComplete( () => {
                a.DOFade(1, 1).OnComplete(()=> { this.Blink(a); });
            });
    }
}

'C# > 문제해결' 카테고리의 다른 글

0916 발표용  (0) 2022.09.16
0908 UI스크롤뷰의 비율  (0) 2022.09.08
0830 머신러닝 Ray  (0) 2022.08.30
0821 등급관리 프로그램  (1) 2022.08.21
0818 맵만들기  (0) 2022.08.18