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

GameObjectProxySystem

Syadeu edited this page Oct 21, 2021 · 8 revisions

Namespace: Syadeu.Presentation.Proxy
File: GameObjectProxySystem.cs

internal sealed class GameObjectProxySystem : PresentationSystemEntity<GameObjectProxySystem>

이 시스템은 내부 시스템입니다. 어떠한 상황에서든 이 시스템에 직접 접근하는 것은 권장되지 않습니다. 상위 시스템인 EntitySystem 을 참조하세요.

Inheritance: PresentationSystemEntity<T> -> GameObjectProxySystem

Overview

  • UnityEngine.GameObject 를 프록시로 사용하기 위한 시스템입니다

Remarks

UnityEngine.GameObject 는 상속받는 UnityEngine.Component 의 개수가 많아질 수록 성능이 비례하여 감소합니다. GameObjectProxySystem (이하 프록시 시스템) 은 이를 회피하고, 게임의 카메라에서 보여지는 객체들만 사용하도록 proxy pattern 으로 설계되었습니다.

EntitySystem 을 통해 GameObject (Entity<T>) 를 매우 많이 생성하여도, 실제 화면에 비춰지는 객체의 개수만 생성하여 직전 프레임에 화면에 배치하고 노출시킵니다. 만약 50만개를 생성하였고, 화면에는 3천개의 객체만 보여진다면 3천개의 GameObject 만 생성하여 표시합니다. 더 이상 화면에 비춰지지 않거나 파괴된 GameObject 는 Pool 로 돌아가며, 이후 다른 Entity<T> 의 프록시에 초기화 된 후 배치됩니다.

Description

프록시 시스템의 가장 꽃이라 부를 수 있는 것은 GameObject 의 무한한 재사용입니다. PrefabList 에서 등록되어 EntitySystem 을 통해 Factorying 된 객체들은 얼마든 다시 재초기화되어 프록시 시스템에서 사용가능하므로, 목표로 하는 Prefab 의 child tree 복잡도가 증가할 수록 기본 UnityEngine 과의 성능 차이가 기하급수적으로 증가합니다.

프록시 데이터의 검색량도 대규모 검색에 대응하도록 클러스터 데이터 정렬 방식 (Cluster<T> 를 참조하세요) 이 사용되었습니다. 프록시 데이터는 Translation 값을 기준으로 데이터가 world matrix 에서 그룹별로 정렬되며, 검색시에는 검색할 곳의 위치로 그룹을 먼저 검색 후, 해당 그룹의 하위 자식들을 검색합니다. 검색 효율은 그룹 블럭안에 자식 (프록시 데이터) 가 많이 포함될 수록, 객체의 밀집도가 높을 수록 증가합니다.

Examples

프록시 시스템은 사용자가 직접 접근할 수 없는 시스템 객체입니다. EntitySystem 을 참조하세요.


- 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