---
title: 플레이어 루프 커스터마이징
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/ko-kr/engine/6000.0/manual/scripting/object-oriented-development/managing-update-order/player-loop-customizing
latest_url: https://docs.unity.com/ko-kr/engine/7000.0/manual/scripting/object-oriented-development/managing-update-order/player-loop-customizing.md
generated_at: 2026-11-19T13:46:13.003Z
locale: ko-kr
---

# 플레이어 루프 커스터마이징

> 플레이어 루프를 커스터마이즈하여 Unity 루프의 각 반복에서 시스템을 업데이트하는 순서를 변경합니다.

Unity 런타임 애플리케이션은 플레이어 루프라는 연속 루프로 실행됩니다. 플레이어 루프를 반복할 때마다 Unity 렌더링, 물리 시뮬레이션, 입력 처리와 같은 작업을 수행하기 위해 다양한 시스템을 호출합니다.

플레이어 루프 동안 업데이트되는 다양한 시스템과 보조 시스템은 정의된 기본 순서로 호출됩니다. [`PlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop.md) API의 정적 메서드를 사용하여 이 순서를 확인하고 사용자 지정할 수 있습니다. 기본 또는 현재 플레이어 루프를 가져와서 고유한 커스텀 플레이어 루프 시스템을 삽입하거나 기존 루프 시스템을 제거, 재정렬 또는 교체할 수 있습니다.

다음과 같은 몇 가지 이유로 플레이어 루프를 커스터마이즈할 수 있습니다.

* 커스텀 [업데이트 관리자](/engine/6000.0/manual/scripting/object-oriented-development/managing-update-order/events-per-frame-optimization.md)의 일환으로 자체적으로 관리되는 업데이트를 생성하면 Unity의 네이티브 이벤트 함수보다 더 뛰어난 대안이 될 수 있습니다. 자세한 내용은 Unity 블로그의 [10000 Update Calls](https://unity.com/blog/engine-platform/10000-update-calls)를 참조하십시오.
* 예를 들어 모바일 게임의 물리, AI 및 XR 업데이트를 제거하여 특정 플랫폼에 맞게 플레이어 루프를 최적화할 수 있습니다.
* 디버깅에 도움이 되도록 편집 모드 또는 플레이 모드에서 업데이트 루프 시각화를 생성할 수 있습니다.

## 플레이어 루프 액세스##accessing-the-player-loop

플레이어 루프는 일련의 중첩된 플레이어 루프 시스템으로 구성되며, 각각은 [`PlayerLoopSystem`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloopsystem.md) 구조입니다. 루트 또는 가장 외부 플레이어 루프 시스템은 다른 플레이어 루프 시스템이 중첩되는 전체 플레이어 루프를 나타냅니다.

여기서 플레이어 루프 시스템은 플레이어 루프 동안 업데이트해야 하는 모든 요소를 추상적으로 나타내는 것입니다. 기본 시스템은 오디오 및 입력과 같은 네이티브 Unity 시스템의 표현이지만 C# 코드에서 자체 커스텀 시스템을 만들 수도 있습니다.

Unity의 기본 플레이어 루프에 액세스하려면 [`PlayerLoop.GetDefaultPlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop/getdefaultplayerloop.md)를 사용합니다. 현재 적용 중인 플레이어 루프에 액세스하려면 [`PlayerLoop.GetCurrentPlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop/getcurrentplayerloop.md)를 사용합니다. 새 커스텀 플레이어 루프를 [`PlayerLoop.SetPlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop/setplayerloop.md)로 적용하지 않는 한 기본 및 현재 플레이어 루프는 동일합니다.

플레이어 루프의 각 시스템에는 이를 식별하는 [`PlayerLoopSystem.type`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloopsystem/type.md) 프로퍼티가 있습니다. 플레이어 루프 시스템 구조에 대해 재귀적으로 반복하고 각 `type` 프로퍼티의 [`Name`](https://learn.microsoft.com/en-us/dotnet/api/system.reflection.memberinfo.name?view=net-9.0#system-reflection-memberinfo-name)를 출력하여 콘솔에 플레이어 루프 구조를 표시할 수 있습니다. 다음 예시와 같이 `type` 프로퍼티를 사용하여 추가, 제거 또는 교체할 플레이어 루프 하위 시스템을 식별할 수도 있습니다. 기본 시스템의 유효한 타입은 `UnityEngine.PlayerLoop` 네임스페이스에서 사용할 수 있습니다.

API 레퍼런스 [`PlayerLoop.GetDefaultPlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop/getdefaultplayerloop.md)에는 기본 플레이어 루프를 가져오고 중첩된 플레이어 루프 시스템을 반복하고 해당 `type` 속성의 `Name`를 출력하는 방법의 예가 포함되어 있습니다. 코드는 다음 콘솔 출력을 생성합니다.

```text
ROOT 노드
	TimeUpdate
		WaitForLastPresentationAndUpdateTime
	초기화
		ProfilerStartFrame
		UpdateCameraMotionVectors
		DirectorSampleTime
		AsyncUploadTimeSlicedUpdate
		SynchronizeInputs(입력 동기화)
		SynchronizeState
		XREarlyUpdate
	EarlyUpdate
		PollPlayerConnection
		GpuTimestamp
		AnalyticsCoreStatsUpdate
		UnityWebRequestUpdate
		ExecuteMainThreadJobs
		ProcessMouseInWindow
		ClearIntermediateRenderers
		ClearLines
		PresentBeforeUpdate
		ResetFrameStatsAfterPresent
		UpdateAsyncInstantiate
		UpdateAsyncReadbackManager
		UpdateStreamingManager
		UpdateTextureStreamingManager
		UpdatePreloading
		UpdateContentLoading
		RendererNotifyInvisible
		PlayerCleanupCachedData
		UpdateMainGameViewRect
		UpdateCanvasRectTransform
		XRUpdate
		UpdateInputManager
		ProcessRemoteInput
		ScriptRunDelayedStartupFrame
		UpdateKinect
		DeliverIosPlatformEvents
		ARCoreUpdate
		DispatchEventQueueEvents
		Physics2DEarlyUpdate
		PhysicsResetInterpolatedTransformPosition
		SpriteAtlasManagerUpdate
		PerformanceAnalyticsUpdate
	FixedUpdate
		ClearLines
		NewInputFixedUpdate
		DirectorFixedSampleTime
		AudioFixedUpdate
		ScriptRunBehaviourFixedUpdate
		DirectorFixedUpdate
		LegacyFixedAnimationUpdate
		XRFixedUpdate
		PhysicsFixedUpdate
		Physics2DFixedUpdate
		PhysicsClothFixedUpdate
		DirectorFixedUpdatePostPhysics
		ScriptRunDelayedFixedFrameRate
	PreUpdate
		PhysicsUpdate
		Physics2DUpdate
		PhysicsClothUpdate
		CheckTexFieldInput
		IMGUISendQueuedEvent
		NewInputUpdate
		InputForUIUpdate
		SendMouseEvents
		AIUpdate
		WindUpdate
		UpdateVideo
	update
		ScriptRunBehaviourUpdate
		ScriptRunDelayedDynamicFrameRate
		ScriptRunDelayedTasks
		DirectorUpdate
	PreLateUpdate
		AIUpdatePostScript
		DirectorUpdateAnimationBegin
		LegacyAnimationUpdate
		DirectorUpdateAnimationEnd
		DirectorDeferredEvaluate
		AccessibilityUpdate
		UIElementsUpdatePanels
		EndGraphicsJobsAfterScriptUpdate
		ConstraintManagerUpdate
		ParticleSystemBeginUpdateAll
		Physics2DLateUpdate
		PhysicsLateUpdate
		ScriptRunBehaviourLateUpdate
	PostLateUpdate
		PlayerSendFrameStarted
		DirectorLateUpdate
		ScriptRunDelayedDynamicFrameRate
		PhysicsSkinnedClothBeginUpdate
		UpdateRectTransform
		PlayerUpdateCanvases
		UIElementsRepaintPanels
		UpdateAudio
		VFXUpdate
		ParticleSystemEndUpdateAll
		EndGraphicsJobsAfterScriptLateUpdate
		UpdateCustomRenderTextures
		XRPostLateUpdate
		UpdateAllRenderers
		UpdateLightProbeProxyVolumes
		EnlightenRuntimeUpdate
		UpdateAllSkinnedMeshes
		ProcessWebSendMessages
		SortingGroupsUpdate
		UpdateVideoTextures
		UpdateVideo
		DirectorRenderImage
		PlayerEmitCanvasGeometry
		UIElementsRenderBatchModeOffscreen
		PhysicsSkinnedClothFinishUpdate
		FinishFrameRendering
		BatchModeUpdate
		PlayerSendFrameComplete
		UpdateCaptureScreenshot
		PresentAfterDraw
		ClearImmediateRenderers
		PlayerSendFramePostPresent
		UpdateResolution
		InputEndFrame
		TriggerEndOfFrameCallbacks
		GUIClearEvent
		ShaderHandleErrors
		ResetInputAxis
		ThreadedLoadingDebug
		ProfilerSynchronizeStats
		MemoryFrameMaintenance
		ExecuteGameCenterCallbacks
		XRPreEndFrame
		ProfilerEndFrame
		GraphicsWarmupPreloadedShaders
		ObjectDispatcherPostLateUpdate
```

## 커스텀 업데이트를 기본 플레이어 루프에 삽입합니다.##insert-a-custom-update-into-the-default-player-loop

플레이어 루프를 커스터마이즈하는 권장되는 가장 낮은 위험 방식은 커스텀 플레이어 루프 시스템을 기본 플레이어 루프에 삽입하는 것입니다. 이렇게 하면 Unity 빌트인 시스템을 방해하지 않고도 고유한 커스텀 업데이트 로직을 추가할 수 있습니다.

[`PlayerLoop.SetPlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop/setplayerloop.md) API 레퍼런스의 코드 예제는 지정된 지점에서 커스텀 플레이어 루프 시스템을 기본 플레이어 루프에 삽입하는 방법을 보여 줍니다. 이 경우, `CustomUpdate` 메서드의 동작은 `InsertSystem` 클래스에서 정의됩니다. 그러나 다음의 작은 수정 사항은 `CustomUpdate`를 MonoBehaviour 스크립트가 구독하고 자체 업데이트 로직을 제공할 수 있는 이벤트로 만들 수 있습니다.

* 이벤트를 `InsertSystem` 클래스의 공용 정적 필드로 선언합니다.

```lang-cs
public static event Action AddCustomUpdate;
```

* 이 이벤트를 호출하려면 `CustomUpdate` 메서드의 정의를 수정합니다.

```lang-cs
private static void CustomUpdate() => AddCustomUpdate?.Invoke();
```

그런 다음 다음과 같이 모든 MonoBehaviour 스크립트에서 커스텀 업데이트를 구독할 수 있습니다.

```cs
using UnityEngine;

public class CustomUpdateFromEvent : MonoBehaviour
{
    private void OnEnable()
    {
        InsertSystem.AddCustomUpdate += MyCustomUpdate;
    }

    private void Update()
    {
        Debug.Log("Update");
    }

    private void LateUpdate()
    {
        Debug.Log("Late Update");
    }

    private void OnDisable()
    {
        InsertSystem.AddCustomUpdate -= MyCustomUpdate;
    }

    private void MyCustomUpdate()
    {
        Debug.Log("Custom update from an event that your MonoBehaviour scripts can subscribe to.");
    }
}
```

> **Note:**
>
> [`PlayerLoop.SetPlayerLoop`](/engine/6000.0/script-reference/unityengine/lowlevel/playerloop/setplayerloop.md)에 파라미터로 전달하는 플레이어 루프 시스템은 현재 플레이어 루프를 덮어씁니다. 따라서 이 메서드에 전달하는 루프에는 교체하지 않는 시스템을 포함하여 유지하려는 모든 시스템이 포함되어 있는지 확인합니다. 새 플레이어 루프 시스템을 처음부터 생성하는 경우 새 루프에 유지하려는 모든 시스템을 명시적으로 추가해야 합니다.

## 플레이어 루프에서 기본 시스템 교체##replace-a-default-system-in-the-player-loop

다음 예시에서는 플레이어 루프의 기본 시스템을 커스텀 업데이트로 대체합니다. 예제는 `PreUpdate.AIUpdate` 시스템을 대체하지만 플레이어 루프의 모든 시스템을 [PlayerLoopSystem.type](/engine/6000.0/script-reference/unityengine/lowlevel/playerloopsystem/type.md) 식별자를 지정하여 대체할 수 있습니다. 기본 시스템의 유효한 타입은 이전 섹션에 나온 것처럼 기본 플레이어 루프를 반복하거나 `UnityEngine.PlayerLoop` 네임스페이스에서 얻을 수 있습니다.

> **Important:**
>
> 플레이어 루프에서 시스템을 교체하면 시스템의 기본 기능이 제거되므로 의도치 않은 결과가 발생할 수 있습니다. 기본 기능을 고유한 커스텀 로직으로 대체하려는 경우에만 이 메서드를 주의해서 사용합니다.

```cs
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
using UnityEngine;

// Replace an existing system in the Unity Player Loop with a custom update.

public class MyReplacementCustomUpdate { } // Empty class to use as a type identifier for the custom update

public class SystemReplacement
{
    //Run this method on runtime initialization
    [RuntimeInitializeOnLoadMethod]
    private static void AppStart()
    {
        // Retrieve the default Player loop system. 기본값이 이전에 수정된 경우 현재 루프를 대신 가져옵니다.
        var defaultSystems = PlayerLoop.GetDefaultPlayerLoop();
        // Create a custom update system to replace an existing one
        var customUpdate = new PlayerLoopSystem()
        {
            updateDelegate = CustomUpdate,
            type = typeof(MyReplacementCustomUpdate)
        };
        // Specify the system to replace as the type parameter, in this case PreUpdate.AIUpdate
        ReplaceSystem<PreUpdate.AIUpdate>(ref defaultSystems, customUpdate)
        PlayerLoop.SetPlayerLoop(defaultSystems);
    }

    // Custom update method that will be called in the Player Loop
    private static void CustomUpdate()
    {
        Debug.Log("Custom update from a replacement system.");
    }

    //Recursively replace a system of type T with a replacement system in the Player Loop
    전용 정적 부울 ReplaceSystem<T>(ref PlayerLoopSystem system, PlayerLoopSystem 교체)
    {
        if (system.type == typeof(T))
        {
            system = replacement;
            return true;
        }
        if (system.subSystemList != null)
        {
            for (var i = 0; i < system.subSystemList.Length; i++)
            {
                if (ReplaceSystem<T>(ref system.subSystemList[i], replacement))
                {
                    return true;
                }
            }
        }
        return false;
    }
}
```

## 추가 리소스 및 예제##additional-resources-and-examples

* **문서**: [이벤트 함수 실행 순서](/engine/6000.0/manual/scripting/object-oriented-development/managing-update-order/execution-order.md)
* API 레퍼런스
* **문서**: [10000 업데이트 호출](https://unity.com/blog/engine-platform/10000-update-calls)
* Unity Discussions의 **커뮤니티**: [`LowLevel.PlayerLoop` 항목](https://discussions.unity.com/search?expanded=true\&q=LowLevel.PlayerLoop%20order%3Alatest_topic)
