반응형
- 코드 작성
using System.Collections;
using System.Collections.Generic;
using UniRx;
using UnityEngine;
using UnityEngine.UI;
public class TimerUniRX : MonoBehaviour
{
public Text timerText;
private int timerIndex = 0;
private void Start()
{
Observable.Timer(System.TimeSpan.FromSeconds(1))
.Repeat()
.Subscribe(_ => UpdateTimer());
}
void UpdateTimer()
{
timerIndex++;
timerText.text = timerIndex.ToString();
}
}
참고할만한 글
반응형
'개발 > Unirx' 카테고리의 다른 글
유니티 Unirx 트리거 사용법 간단 예시 Triggers (0) | 2024.02.17 |
---|---|
유니티 Unirx 구독 이벤트 간단 정리 Subscribe (0) | 2024.02.17 |
유니티 C# UniRX 코루틴 Coroution 간단 사용법 (0) | 2022.08.29 |
유니티 C# UniRX ObservableWWW 간단 사용법 (0) | 2022.08.29 |
유니티 C# UniRX 버튼 클릭 Button Click 간단 구현 (0) | 2022.08.29 |
유니티 C# UniRX 더블 클릭 Double Click 간단 구현 (0) | 2022.08.29 |
유니티 UniRX (Reactive Extensions for Unity) 다운로드 (0) | 2022.08.29 |
댓글