WaitUntil은 항상 정말로 답장할 때 프레임을 기다립니까?
4409 단어 Unity
개요
코르크에 WaitUntil을 사용하면 진짜로 기다릴 거예요.
만약 항상 진짜로 되돌아온다면, yeld return null처럼 프레임을 기다립니까?
컨디션
Unity5.5.2p4
결실
대기 2
실험 내용
Unity 스크립트는 다음과 같습니다.
Supplied delegate will be executed each frame after script MonoBehaviour.Update and before MonoBehaviour.LateUpdate. When the delegate finally evaluates to true, the coroutine will proceed with its execution.
Update와 LateUpdate 사이에서 수행합니다.
이 기간 동안 출력 로그를 확인합니다.using UnityEngine;
using System.Collections;
public class TestWaitUntil : MonoBehaviour
{
private void Start()
{
StartCoroutine(Loop());
StartCoroutine(Loop2());
}
private void Update()
{
Debug.Log("Update()");
}
private void LateUpdate()
{
Debug.Log("LateUpdate()");
}
IEnumerator Loop()
{
WaitUntil wait = new WaitUntil(() => { return true; });
while(true)
{
Debug.Log("Loop() Start WaitUntil.");
yield return wait;
Debug.Log("Loop() End WaitUntil.");
}
}
IEnumerator Loop2()
{
while(true)
{
Debug.Log("Loop2() Start.");
yield return null;
Debug.Log("Loop2() End.");
}
}
}
로그 출력 Loop() Start WaitUntil.
Loop2() Start.
Update()
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
후기
물론 시리즈.
일드문 있으니까 기다려.
안 그러면 무한순환이야.
Reference
이 문제에 관하여(WaitUntil은 항상 정말로 답장할 때 프레임을 기다립니까?), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/akerusoft/items/43d0a7ad5d5c24934afe
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Unity5.5.2p4
결실
대기 2
실험 내용
Unity 스크립트는 다음과 같습니다.
Supplied delegate will be executed each frame after script MonoBehaviour.Update and before MonoBehaviour.LateUpdate. When the delegate finally evaluates to true, the coroutine will proceed with its execution.
Update와 LateUpdate 사이에서 수행합니다.
이 기간 동안 출력 로그를 확인합니다.using UnityEngine;
using System.Collections;
public class TestWaitUntil : MonoBehaviour
{
private void Start()
{
StartCoroutine(Loop());
StartCoroutine(Loop2());
}
private void Update()
{
Debug.Log("Update()");
}
private void LateUpdate()
{
Debug.Log("LateUpdate()");
}
IEnumerator Loop()
{
WaitUntil wait = new WaitUntil(() => { return true; });
while(true)
{
Debug.Log("Loop() Start WaitUntil.");
yield return wait;
Debug.Log("Loop() End WaitUntil.");
}
}
IEnumerator Loop2()
{
while(true)
{
Debug.Log("Loop2() Start.");
yield return null;
Debug.Log("Loop2() End.");
}
}
}
로그 출력 Loop() Start WaitUntil.
Loop2() Start.
Update()
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
후기
물론 시리즈.
일드문 있으니까 기다려.
안 그러면 무한순환이야.
Reference
이 문제에 관하여(WaitUntil은 항상 정말로 답장할 때 프레임을 기다립니까?), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/akerusoft/items/43d0a7ad5d5c24934afe
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Unity 스크립트는 다음과 같습니다.
Supplied delegate will be executed each frame after script MonoBehaviour.Update and before MonoBehaviour.LateUpdate. When the delegate finally evaluates to true, the coroutine will proceed with its execution.
Update와 LateUpdate 사이에서 수행합니다.
이 기간 동안 출력 로그를 확인합니다.
using UnityEngine;
using System.Collections;
public class TestWaitUntil : MonoBehaviour
{
private void Start()
{
StartCoroutine(Loop());
StartCoroutine(Loop2());
}
private void Update()
{
Debug.Log("Update()");
}
private void LateUpdate()
{
Debug.Log("LateUpdate()");
}
IEnumerator Loop()
{
WaitUntil wait = new WaitUntil(() => { return true; });
while(true)
{
Debug.Log("Loop() Start WaitUntil.");
yield return wait;
Debug.Log("Loop() End WaitUntil.");
}
}
IEnumerator Loop2()
{
while(true)
{
Debug.Log("Loop2() Start.");
yield return null;
Debug.Log("Loop2() End.");
}
}
}
로그 출력 Loop() Start WaitUntil.
Loop2() Start.
Update()
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
후기
물론 시리즈.
일드문 있으니까 기다려.
안 그러면 무한순환이야.
Reference
이 문제에 관하여(WaitUntil은 항상 정말로 답장할 때 프레임을 기다립니까?), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/akerusoft/items/43d0a7ad5d5c24934afe
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Loop() Start WaitUntil.
Loop2() Start.
Update()
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
LateUpdate()
Update()
Loop() End WaitUntil.
Loop() Start WaitUntil.
Loop2() End.
Loop2() Start.
물론 시리즈.
일드문 있으니까 기다려.
안 그러면 무한순환이야.
Reference
이 문제에 관하여(WaitUntil은 항상 정말로 답장할 때 프레임을 기다립니까?), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/akerusoft/items/43d0a7ad5d5c24934afe텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)