Class UISystemBase
Base class for System that controls UI screens.
To use it, create a new class that inherits from UISystemBase.
If you want the system to collect all existing screens from scene,
override IsCollectUIScreensFromSceneOnStart property IsCollectUIScreensFromSceneOnStart.
Call an ApplyConfig() method to make the UI system be able to create screens by request
(it uses prefabs copied from the list provided into this method) ApplyConfig(IList<UIScreen>).
Inheritance
ComponentSystemBase
SystemBase
UISystemBase
Inherited Members
SystemBase.Dependency
SystemBase.CheckedStateRef
SystemBase.CompleteDependency()
SystemBase.Entities
SystemBase.Job
SystemBase.Update()
SystemBase.GetComponent<T>(Entity)
SystemBase.SetComponent<T>(Entity, T)
SystemBase.HasComponent<T>(Entity)
SystemBase.HasBuffer<T>(Entity)
SystemBase.GetEntityStorageInfoLookup()
SystemBase.GetStorageInfoFromEntity()
SystemBase.Exists(Entity)
ComponentSystemBase.Enabled
ComponentSystemBase.EntityQueries
ComponentSystemBase.GlobalSystemVersion
ComponentSystemBase.LastSystemVersion
ComponentSystemBase.EntityManager
ComponentSystemBase.World
ComponentSystemBase.SystemHandle
ComponentSystemBase.SystemHandleUntyped
ComponentSystemBase.Time
ComponentSystemBase.WorldUpdateAllocator
ComponentSystemBase.OnStartRunning()
ComponentSystemBase.OnStopRunning()
ComponentSystemBase.OnDestroy()
ComponentSystemBase.ShouldRunSystem()
ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
ComponentSystemBase.GetSharedComponentTypeHandle<T>()
ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
ComponentSystemBase.GetEntityTypeHandle()
ComponentSystemBase.RequireForUpdate(EntityQuery)
ComponentSystemBase.RequireAnyForUpdate(params EntityQuery[])
ComponentSystemBase.RequireAnyForUpdate(NativeArray<EntityQuery>)
ComponentSystemBase.RequireForUpdate<T>()
ComponentSystemBase.RequireSingletonForUpdate<T>()
ComponentSystemBase.HasSingleton<T>()
ComponentSystemBase.GetSingleton<T>()
ComponentSystemBase.GetSingletonRW<T>()
ComponentSystemBase.TryGetSingleton<T>(out T)
ComponentSystemBase.TryGetSingletonBuffer<T>(out DynamicBuffer<T>)
ComponentSystemBase.SetSingleton<T>(T)
ComponentSystemBase.GetSingletonEntity<T>()
ComponentSystemBase.TryGetSingletonEntity<T>(out Entity)
ComponentSystemBase.GetEntityQuery(params ComponentType[])
ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
ComponentSystemBase.GetEntityQuery(params EntityQueryDesc[])
ComponentSystemBase.GetEntityQuery(in EntityQueryBuilder)
Assembly: fwt.core.ecs.dll
Syntax
public abstract class UISystemBase : SystemBase
Fields
AllScreens
List of all screens system knows about (created by the system or found in the scene).
Declaration
public List<UIScreen> AllScreens
Field Value
ScreenPrefabByName
Declaration
public Dictionary<string, UIScreen> ScreenPrefabByName
Field Value
ScreenPrefabByType
Declaration
public Dictionary<Type, UIScreen> ScreenPrefabByType
Field Value
ScreenPrefabs
Declaration
public List<UIScreen> ScreenPrefabs
Field Value
ScreensByName
Dictionary of all screens system knows about (created by the system or found in the scene).
Key - Screen name. CreateScreen(string)
Declaration
public Dictionary<string, UIScreen> ScreensByName
Field Value
ScreensByType
Dictionary of all screens system knows about (created by the system or found in the scene).
Key - Screen type. CreateScreen(Type)
Declaration
public Dictionary<Type, UIScreen> ScreensByType
Field Value
Properties
IsCollectUIScreensFromSceneOnStart
If true, OnCreate will collect all UIScreens from the scene using Objecct.FindAllObjectsOfType
Declaration
public abstract bool IsCollectUIScreensFromSceneOnStart { get; }
Property Value
UIRoot
Root object of the UI system.
This object is created if none is found in the scene.
Declaration
public UIRoot UIRoot { get; }
Property Value
UIScreenRoot
Root transforms for place a UIScreen when it is created.
The transform of the UIRoot UIRoot
Declaration
public Transform UIScreenRoot { get; }
Property Value
| Type |
Description |
| Transform |
|
Methods
AddScreenPrefab(UIScreen)
Declaration
public virtual void AddScreenPrefab(UIScreen screenPrefab)
Parameters
| Type |
Name |
Description |
| UIScreen |
screenPrefab |
|
ApplyConfig(IList<UIScreen>)
Copies the provided list of screen prefabs into the system,
so it can use those prefabs to create screens on request.
Declaration
public virtual void ApplyConfig(IList<UIScreen> screenPrefabs)
Parameters
CollectUIScreensFromScene()
Declaration
protected virtual void CollectUIScreensFromScene()
CreateScreen(UIScreen)
Declaration
public virtual UIScreen CreateScreen(UIScreen screenPrefab)
Parameters
| Type |
Name |
Description |
| UIScreen |
screenPrefab |
|
Returns
CreateScreen(string)
Creates a new screen of the specified name.
Takes a prefab in the ScreenPrefabByName dictionary ScreenPrefabByName
Declaration
public virtual UIScreen CreateScreen(string screenName)
Parameters
| Type |
Name |
Description |
| string |
screenName |
name of the UIScreen taken from UIScreen.Name when importing prefabsName
|
Returns
| Type |
Description |
| UIScreen |
created UIScreen instance
|
CreateScreen(Type)
Creates a new screen of the specified type.
Takes a prefab in the ScreenPrefabByType dictionary ScreenPrefabByType
Declaration
public virtual UIScreen CreateScreen(Type screenType)
Parameters
| Type |
Name |
Description |
| Type |
screenType |
type of the screen to create (looks for prefab in ScreenPrefabByType dictionary)
|
Returns
| Type |
Description |
| UIScreen |
created UIScreen instance
|
CreateScreen<TScreen>()
Declaration
public virtual TScreen CreateScreen<TScreen>() where TScreen : UIScreen
Returns
Type Parameters
CreateScreen<TScreen>(string)
Creates a new screen of the specified type.
Declaration
public virtual TScreen CreateScreen<TScreen>(string screenName) where TScreen : UIScreen
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
Returns
| Type |
Description |
| TScreen |
screen instance
|
Type Parameters
| Name |
Description |
| TScreen |
type of the screen to create
|
DeleteAllScreenPrefabs()
Declaration
public virtual void DeleteAllScreenPrefabs()
DeleteScreenPrefab(UIScreen)
Declaration
public virtual void DeleteScreenPrefab(UIScreen screenPrefab)
Parameters
| Type |
Name |
Description |
| UIScreen |
screenPrefab |
|
DeleteScreenPrefab(string)
Declaration
public virtual void DeleteScreenPrefab(string screenName)
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
DeleteScreenPrefab<TScreen>()
Declaration
public virtual void DeleteScreenPrefab<TScreen>() where TScreen : UIScreen
Type Parameters
DestroyAllScreens()
Destroys all UIScreen instances known by the system AllScreens.
Declaration
public virtual void DestroyAllScreens()
DestroyScreen(UIScreen)
Destroys the specified screen instance.
Declaration
public virtual bool DestroyScreen(UIScreen screen)
Parameters
| Type |
Name |
Description |
| UIScreen |
screen |
screen instance to destroy
|
Returns
| Type |
Description |
| bool |
true if the screen was destroyed successfully; otherwise, false
|
DestroyScreen(string)
Declaration
public virtual void DestroyScreen(string screenName)
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
DestroyScreen(Type)
Declaration
public virtual bool DestroyScreen(Type screenType)
Parameters
| Type |
Name |
Description |
| Type |
screenType |
|
Returns
DestroyScreen<TScreen>()
Destroys the specified screen.
Declaration
public virtual bool DestroyScreen<TScreen>() where TScreen : UIScreen
Returns
| Type |
Description |
| bool |
true if the screen was destroyed successfully; otherwise, false
|
Type Parameters
| Name |
Description |
| TScreen |
type of a screen to destroy
|
FindObjectOnScene<TObject>(ref TObject, FindObjectsInactive)
Declaration
public virtual TObject FindObjectOnScene<TObject>(ref TObject obj, FindObjectsInactive filter = FindObjectsInactive.Include) where TObject : MonoBehaviour
Parameters
| Type |
Name |
Description |
| TObject |
obj |
|
| FindObjectsInactive |
filter |
|
Returns
Type Parameters
GetOrCreateScreen(string)
Declaration
public virtual UIScreen GetOrCreateScreen(string screenName)
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
Returns
GetOrCreateScreen(Type)
Declaration
public virtual UIScreen GetOrCreateScreen(Type screenType)
Parameters
| Type |
Name |
Description |
| Type |
screenType |
|
Returns
GetOrCreateScreen<TScreen>()
Gets an existing screen of the specified type, or creates a new one if it doesn't exist.
Declaration
public virtual TScreen GetOrCreateScreen<TScreen>() where TScreen : UIScreen
Returns
| Type |
Description |
| TScreen |
screen instance
|
Type Parameters
| Name |
Description |
| TScreen |
type of the screen to get or create
|
GetOrCreateScreen<TScreen>(string)
Declaration
public virtual TScreen GetOrCreateScreen<TScreen>(string screenName) where TScreen : UIScreen
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
Returns
Type Parameters
GetScreen(string)
Declaration
public virtual UIScreen GetScreen(string screenName)
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
Returns
GetScreen(Type)
Declaration
public virtual UIScreen GetScreen(Type screenType)
Parameters
| Type |
Name |
Description |
| Type |
screenType |
|
Returns
GetScreenPrefab(string)
Declaration
public virtual UIScreen GetScreenPrefab(string screenName)
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
Returns
GetScreenPrefab(Type)
Declaration
public virtual UIScreen GetScreenPrefab(Type screenType)
Parameters
| Type |
Name |
Description |
| Type |
screenType |
|
Returns
GetScreenPrefab<TScreen>()
Declaration
public virtual TScreen GetScreenPrefab<TScreen>() where TScreen : UIScreen
Returns
Type Parameters
GetScreenPrefab<TScreen>(string)
Declaration
public virtual TScreen GetScreenPrefab<TScreen>(string screenName) where TScreen : UIScreen
Parameters
| Type |
Name |
Description |
| string |
screenName |
|
Returns
Type Parameters
GetScreen<TScreen>()
Gets an existing screen of the specified type if found.
Declaration
public virtual TScreen GetScreen<TScreen>() where TScreen : UIScreen
Returns
Type Parameters
| Name |
Description |
| TScreen |
type of the screen to get
|
IsCursorOverUI()
Returns true if some UI element is under the cursor.
Uses the
Declaration
public virtual bool IsCursorOverUI()
Returns
OnCreate()
Called when this system is created.
Declaration
protected override void OnCreate()
Overrides
Unity.Entities.ComponentSystemBase.OnCreate()
OnUpdate()
Implement OnUpdate() to perform the major work of this system.
Declaration
protected override void OnUpdate()
Overrides
Unity.Entities.SystemBase.OnUpdate()
Extension Methods