Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

CoreSystem SM StartBackgroundUpdate

syadeu edited this page Apr 5, 2021 · 2 revisions

StartBackgroundUpdate

public static CoreRoutine StartBackgroundUpdate(object obj, IEnumerator update)

Parameters

Return

Exceptions

Examples

아래는 CoreSystem 객체에서 관리 중인 Background Thread 에 Unity Coroutine과 거의 동일한 방식으로 iteration 을 요청하는 방법을 설명합니다.

public class CoreSystemTests
{
    public IEnumerator TestWhileCoreRoutine()
    {
        Debug.Log("Routine Start");
        yield return null;

        while (true)
        {
            yield return null;
        }
    }
    public IEnumerator BackgroundUpdateTest()
    {
        CoreRoutine routine = CoreSystem.StartBackgroundUpdate(this, TestWhileCoreRoutine());

        UnityEngine.Debug.Log("Wait 2 seconds");
        yield return new WaitForSeconds(2);

        UnityEngine.Debug.Log($"{routine.IsRunning} isrunning");
        yield return null;

        BackgroundJob job = CoreSystem.RemoveBackgroundUpdate(routine);
        yield return new WaitForBackgroundJob(job);
        UnityEngine.Debug.Log("remove routine");

        UnityEngine.Debug.Log($"{routine.IsRunning} isrunning");
  
        // Expected Logs
        //
        // Routine Start (or) Wait 2 seconds
        // Wait 2 seconds (or) Routine Start
        // True isrunning
        // remove routine
        // False isrunning
    }
}
- Interfaces
- Enums
- Attributes
- Abstract Classes
- Classes
- Structs
- Exceptions

- Syadeu.Presentation
- Syadeu.Collections
- Syadeu.Collections.Converters
- Syadeu.Collections.Proxy
- Syadeu.Presentation.Proxy
- Syadeu.Presentation.Internal
- Syadeu.Presentation.Entities
- Syadeu.Presentation.Attributes
- Syadeu.Presentation.Components
- Syadeu.Presentation.Actions
- Syadeu.Presentation.Render
  • CameraData
  • CameraFrustum
  • IntersectionType
  • RenderSystem
  • WorldCanvasSystem
- Syadeu.Presentation.Data
  • DataContainerSystem
  • DataObjectBase
  • EntityAnimationClipEventData
- Syadeu.Presentation.Events

Clone this wiki locally