This repository was archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
RecycleableMonoBehaviour
Syadeu edited this page Oct 22, 2021
·
6 revisions
# Moved to Syadeu.Presentation.Proxy from Syadeu.Mono at 2.0.2
Namespace: Syadeu.Presentation.Proxy
File: RecycleableMonobehaviour.cs
[DisallowMultipleComponent]
public abstract class RecycleableMonobehaviour : MonoBehaviour, IRecycleable, ITerminateInheritance: UnityEngine.MonoBehaviour -> RecycleableMonobehaviour
Derived: ManagedRecycleObject
Implements: IProxyMonobehaviour, INotificationReceiver
-
GameObjectProxySystem 에서 사용하는
abstract객체입니다. - 간단하게 프록시 시스템에 편입 할 수 있는 Mono 객체를 작성 할 수 있습니다.
GameObjectProxySystem 에서 이 abstract를 상속받는 오브젝트를 불러오게되면, 기본 컴포넌트로 ManagedRecycleObject 컴포넌트를 추가하여 반환합니다.
이 abstract 를 참조함으로써, 불필요한 컴포넌트 객체 갯수를 줄이고, 빠르게 풀링 시스템에 편입함으로서 게임에서의 성능 최적화를 기대할 수 있습니다.
아래는 간단한 풀링 객체를 생성하기 위해 Mono 컴포넌트를 작성하는 방법에 대해 설명합니다.
public sealed class ManagedRecycleObject : RecycleableMonobehaviour
{
// 이 예제에서는 간단히 delegate를 씬과 함께 저장할 수 있는
// UnityEngine.Events.UnityEvent 로 유동적인 사용자 함수 호출을 보여줍니다.
public UnityEvent onCreation;
public UnityEvent onInitializion;
public UnityEvent onTermination;
// PrefabManager 인스펙터 뷰에서 보여질 이름을 설정합니다.
// 런타임에는 아무런 영향을 끼치지 않습니다.
public override string DisplayName => name;
// 이 재사용 오브젝트가 PrefabManager에 의해 처음으로 생성되었을때 호출되는 함수입니다.
public override void OnCreated() => onCreation?.Invoke();
// 이 재사용 오브젝트가 재사용 풀에서 대기 중, 요청에 의해 다시 꺼내져왔을때 호출되는 함수입니다.
public override void OnInitialize() => onInitializion?.Invoke();
// 이 재사용 오브젝트가 사용을 마치고, 재사용 풀로 되돌아 갈때 호출되는 함수입니다.
public override void OnTerminate() => onTermination?.Invoke();
}| Name | Description |
|---|---|
| bool TerminatedCondition() |
| Name | Description |
|---|---|
| onTerminateAction | 이 객체가 재사용 풀로 되돌아갈때 실행되는 delegate 입니다. |
| onTerminate | 이 객체가 재사용 풀로 되돌아갈때 실행되는 delegate 입니다. |
| OnActivated | 이 delegate 는 할당되었을 경우, 매 프레임마다 호출되며 false 를 반환시키면 이 모노객체는 즉시 재사용 풀로 돌아갑니다. |
| Name | Description |
|---|---|
| DisplayName | |
| Activated | 현재 이 재사용 객체가 사용 중 인가요? |
Deprecated WaitForDeletion |
이 재사용 객체가 PrefabManager 에 의한 최적화로 파괴될 예정인가요? |
| Name | Description |
|---|---|
internal Initialize |
|
| OnCreated | 이 오브젝트가 생성되었을때 한번만 실행하는 함수입니다. |
| OnInitialize | 이 오브젝트가 재사용 풀에서 대기 중, 요청에 의해 다시 꺼내져왔을때 호출되는 함수입니다. |
| OnTerminate | 이 오브젝트가 사용을 마치고, 재사용 풀로 되돌아 갈때 호출되는 함수입니다. |
| Terminate | 이 오브젝트의 사용이 완료되었음을 알리는 함수입니다. |
- 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