You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does the UniTask with index 1, 2 and 3 run only once?
I just need a method to make all UniTasks call log in each frame
public class UniTaskTest : MonoBehaviour
{
public int taskCount = 5;
AsyncReactiveProperty<int> Property = new AsyncReactiveProperty<int>(0);
async UniTaskVoid Log(int index)
{
while (true)
{
await Property.WaitAsync();
Debug.Log(index);
}
}
// Start is called before the first frame update
void Start()
{
for (int i = 0; i < taskCount; i++)
Log(i).Forget();
}
// Update is called once per frame
void Update()
{
Property.Value = Time.frameCount;
}
}
The text was updated successfully, but these errors were encountered:
Why does the UniTask with index 1, 2 and 3 run only once?
I just need a method to make all UniTasks call log in each frame
The text was updated successfully, but these errors were encountered: