-
Notifications
You must be signed in to change notification settings - Fork 0
IEntityComponent
Namespace: Syadeu.Collections
public interface IEntityComponentEntityData<T>, Entity<T> 에 추가될 수 있는 컴포넌트를 만듭니다.
Inheritance: System.Object -> IEntityComponent
Derived: asdasd
- 1
사용자는 추가로 IDisposable 을 상속하여 엔티티가 파괴될 때 실행할 메모리 수집을 선언할 수 있습니다. INotifyComponent<TComponent> 를 참조하세요.
선언된 컴포넌트는 EntityData<T>.AddComponent<TComponent>(TComponent), Entity<T>.AddComponent<TComponent>(TComponent) 로 추가할 수 있고, EntityData<T>.GetComponent<TComponent>(), Entity<T>.GetComponent<TComponent>() 를 통해 가져올 수 있습니다.
Runtime 도중, Entity 에 데이터를 저장하거나 가공하고, 이를 Batching 하여 Processing 속도를 극대화 할 수 있습니다. Entity 에 연결하기 위해 선언된 모든 컴포넌트들은 Initialize stage 에서 전부 수집되어 해당 컴포넌트를 저장하기 위한 시스템 버퍼를 생성합니다 (EntityComponentSystem 을 참조하세요). 이로 인해 Runtime 중 Reflection, 혹은 기타 Runtime-compliation 라이브러리등으로 컴포넌트를 새로 작성하는 것은 허용하지 않습니다.
Batching 하여 Parallel Processing 하는 방법에 대해서는 IJobParallelForEntities<TComponent> 를 참조하세요.
아래는 간단한 컴포넌트를 선언하고, 이를 Entity<ActorEntity> 에 연결하는 방법에 대해 설명합니다.
// 컴포넌트는 항상 unmanaged type 이어야합니다.
// 맴버내 reference type 을 포함하거나, 선언된 컴포넌트가
// managed type 일 경우에는 에러를 발생합니다.
public struct TestComponent : IEntityComponent
{
public int testInt;
public bool testBoolen;
}
// Entity 가 있다고 가정합니다.
Entity<ActorEntity> actor = /* ... */ ;
public void TestAddComponent()
{
// 컴포넌트를 해당 Entity 에 추가합니다.
actor.AddComponent<TestComponent>();
// 추가한 컴포넌트를 가져옵니다.
ref TestComponent component = ref actor.GetComponent<TestComponent>();
/*
Some data works..
*/
}컴포넌트로 선언될 타겟은 항상 struct 이고, unmanaged type 이어야 합니다. 이는 Native 에서 byte 로 heap 에 데이터를 저장하기 때문인데, 이를 통해 GC allocation 을 피함과 메모리 접근 속도를 개선할 수 있습니다. 선언된 컴포넌트가 managed type 일 경우에는 에러를 발생합니다.
- Interfaces
- Enums
- SystemFlag
- CoreSystemExceptionFlag
- UserTagFlag
- CustomTagFlag
- ObValueDetection
- ConsoleFlag
- CommandSetting
- Attributes
- Abstract Classes
- Classes
- CoreSystem
- CoreSystemSettings
- PrefabManager
- PrefabList
- RenderManager
- RenderController
-
ConsoleWindow
- CommandDefinition
- CommandField
- CommandRequires
- FMODSystem
- UserTagNameModule
- CustomTagNameModule
- Timer
- BackgroundJob
- ForegroundJob
- WaitForBackgroundJob
- WaitForBackgroundJobWorker
- WaitForForegroundJob
- WaitForTimer
- BackgroundJobWorker
- ObArray
- ObClass
- ObDictionary
- ObList
- ObQueue
- ObValue
- ExtensionMethods
- ThreadSafe
- Structs
- CoreRoutine
- SQLiteDatabase
- SQLiteTable
- SQLiteColumn
- SQLiteVersionInfoTableData
- Bound
- Pole
- Vector2
- Vector3
- Exceptions
- Syadeu.Presentation
- PresentationManager
- SceneList
- EntityDataList
- CustomLoadingScene
- DefaultPresentationGroup
- PresentationGroupEntity
- IPresentationSystemGroup
- PresentationSystemGroup<T>
- PresentationSystem<T>
- PresentationSystem<TGroup, TSystem>
- PresentationSystemEntity<T>
- PresentationSystemModule<TSystem>
- PresentationSystemID
- INotifySystemModule<TModule>
- IExecutable<T>
- PresentationLoop
- PresentationResult
- IReference
- Reference
- SubSystemAttribute
- LoadingSceneSetupEntity
- SceneReference
- SceneSystem
- EntitySystem
- EntityBoundSystem
- EntityRaycastSystem
- EntityExtensionMethods
- AttributeAcceptOnlyAttribute
- EntityAcceptOnlyAttribute
- CoroutineSystem
- CoroutineJob
- ICoroutineJob
- UpdateLoop
- RaycastInfo
- ObjectBase
- ProcessorBase
- WaitForPresentationSystem<T>
- WaitForProxy<T>
- Syadeu.Collections
- AABB
- Plane
- PropertyBlockBase
- PropertyBlock<T>
- ActionWrapper
- BinaryGrid
- CLRContainer
- CLRSingleTone
- CLSTypedDictionary<TValue>
- CLSTypedDictionary<TKey, TValue>
- Direction
- EntityID
- EntityShortID
- IEntityDataID
- IInstance
- IInstance<T>
- Instance
- Instance<T>
- InstanceID
- FixedInstanceList16<T>
- FixedInstanceList64<T>
- IFixedReference
- IFixedReference<T>
- FixedReference
- FixedReference<T>
- FixedReferenceList16<T>
- FixedReferenceList64<T>
- IFixedReferenceList<T>
- FixedListExtensionMethods
- IEntity
- IEntityData
- IAttribute
- IObject
- IEntityComponent
- IPrefabReference
- IPrefabResource
- IEmpty
- IValidation
- FNV1a32
- FNV1a64
- Hash
- 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