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
StaticManager
syadeu edited this page Apr 15, 2021
·
15 revisions
Namespace: Syadeu
public abstract class StaticManager<T> : StaticManagerEntity, IStaticMonoManager where T : Component, IStaticMonoManager>객체 자동 생성 Static 매니저 기본 클래스입니다.
Inheritance: StaticManagerEntity -> StaticManager<T>
Derived: CoreSystem, GridManager, PrefabManager, RenderManager
Implements: IStaticMonoManager
- 사용자가 씬에 일일이 오브젝트를 생성하여 컴포넌트를 붙여넣지 않아도 시스템에서 필요에 의해 생성 가능하도록 함
- 백그라운드 스레드에서 접근하여 생성할때도 안전하게 싱글톤을 생성하여 반환하도록 함
public sealed class ExampleManager : StaticManager<ExampleManager>
{
// Hierarchy에서 표시될 이름을 설정 할 수 있습니다.
// 에디터에서만 활용되며, 실제 빌드에는 아무런 기능을 하지 않습니다.
public override string DisplayName => "Example Manager";
// 이 객체가 씬이 전환될때 파괴될 것인지를 설정 할 수 있습니다.
// 기본 값은 true입니다.
public override bool DontDestroy => false;
// 이 객체가 Hierarchy에서 표시 될 것 인지를 설정 할 수 있습니다.
// 기본 값은 true입니다.
public override bool HideInHierarchy => false;
// 이 객체가 생성될 때, 한번만 호출하는 함수입니다.
// 백그라운드 스레드에서도 부를 수 있으니 사용에 유의해야 됩니다.
public override void OnInitialize()
{
UnityEngine.Debug.Log("Hello World!");
}
// 이 객체가 생성되고 초기화 된 뒤, 맨 마지막에 한번만 호출하는 함수입니다.
// 백그라운드 스레드에서도 부를 수 있으니 사용에 유의해야 됩니다.
public override void OnStart()
{
UnityEngine.Debug.Log("Hello! I\'m Started!");
}
public void TestMethod()
{
UnityEngine.Debug.Log("Test Method Executed!");
}
}ExampleManager.Instance.TestMethod() 를 호출시 자동으로 ExampleManager의 싱글톤 객체를 생성하여 반환합니다.
예상되는 로그는 다음과 같습니다.
Hello World!Hello! I\'m Started!Test Method Executed!
이 싱글톤 객체가 만들어지는 순서는 다음과 같습니다.
- 현재 이 객체의 싱글톤 객체가 씬 안에 존재하는지 체크합니다.
존재한다면 6번으로 건너뛰고, 아니라면 새로운 GameObject 생성합니다. - OnInitialize()를 호출합니다.
- DontDestroy 의 값에 따라, 전역 오브젝트가 될지, 현재씬에서만 사용되고 전환시 버려지는 오브젝트가 될지 설정합니다.
- Instance에 생성된 싱글톤을 할당합니다.
- OnStart()를 호출합니다.
- 새로 생성된 싱글톤 인스턴스 객체를 반환합니다.
| Name | Description |
|---|---|
| Initialized | 이 매니저가 생성되고, 초기화되었는지 반환합니다. |
| Instance | 싱글톤입니다. |
| Name | Description |
|---|---|
| DisplayName | Hierarchy에서 표기될 이름을 설정합니다. 빌드에서는 아무런 기능을 하지 않습니다. |
| DontDestroy | 씬이 전환되어도 파괴되지 않을 것인지를 설정합니다. |
| HideInHierarchy | Hierarchy에 표시될지를 설정합니다. 빌드에서는 아무런 기능을 하지 않습니다. |
| ManualInitialize | 사용자에 의해 수동으로 초기화 할지를 설정합니다. StaticManager를 상속받고 있으면 값은 무조건 false이며 override 될 수 없습니다. |
| Name | Description |
|---|---|
| Initialize | 초기화 함수입니다. |
| OnInitialize | 초기화 될 때 실행될 함수입니다. |
| OnStart | 초기화가 다 끝나고 실행될 함수입니다. |
| Name | Description |
|---|---|
| System | CoreSystem 의 인스턴스 객체를 반환합니다. |
| InstanceGroupTr | 인스턴스 매니저들이 부모로 삼는 최상위 Transform 입니다. |
| ManagerLock | 사용하지마세요 |
| Name | Description |
|---|---|
| MainThread | 유니티 메인 스레드를 반환합니다. |
| BackgroundThread | 백그라운드 스레드를 반환합니다. |
| Name | Description |
|---|---|
| Flag | 현재 시스템의 종류입니다. |
| Name | Description |
|---|---|
| IsMainthread | 이 메소드가 실행된 스레드가 유니티 메인스레드인지 반환합니다. |
| Name | Description |
|---|---|
| ThreadAwaiter | 해당 시간만큼 스레드를 sleep 합니다. |
| AwaitForNotNull |
| Name | Description |
|---|---|
| StartUnityUpdate | 입력한 iterator를 유니티 메인 스레드에서 iteration 합니다. |
| StartBackgroundUpdate | 입력한 iterator를 백그라운드 스레드에서 iteration 합니다. |
| StopUnityUpdate | 입력한 CoreRoutine을 정지합니다. |
| StopBackgroundUpdate | 입력한 CoreRoutine을 정지합니다. |
- 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