Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    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
    object
    ComponentSystemBase
    SystemBase
    UISystemBase
    SamplesUISystem
    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.GetComponentLookup<T>(bool)
    SystemBase.GetComponentDataFromEntity<T>(bool)
    SystemBase.GetBuffer<T>(Entity, bool)
    SystemBase.GetBufferLookup<T>(bool)
    SystemBase.GetBufferFromEntity<T>(bool)
    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.GetComponentTypeHandle<T>(bool)
    ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetBufferTypeHandle<T>(bool)
    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.GetSingletonBuffer<T>(bool)
    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)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.Core.UI.Screens
    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
    Type Description
    List<UIScreen>

    ScreenPrefabByName

    Dictionary of all prefabs of the UI Screens this system can create. Key - Screen name. This dictionary is filled when AddScreenPrefab() is called AddScreenPrefab(UIScreen). ApplyConfig(IList<UIScreen>)

    Declaration
    public Dictionary<string, UIScreen> ScreenPrefabByName
    Field Value
    Type Description
    Dictionary<string, UIScreen>

    ScreenPrefabByType

    Dictionary of all prefabs of the UI Screens this system can create. Key - Screen type. this dictionary is filled when AddScreenPrefab() is called AddScreenPrefab(UIScreen). ApplyConfig(IList<UIScreen>)

    Declaration
    public Dictionary<Type, UIScreen> ScreenPrefabByType
    Field Value
    Type Description
    Dictionary<Type, UIScreen>

    ScreenPrefabs

    List of all prefabs of the UI Screens this system can create. This list is filled when AddScreenPrefab() is called AddScreenPrefab(UIScreen). ApplyConfig(IList<UIScreen>)

    Declaration
    public List<UIScreen> ScreenPrefabs
    Field Value
    Type Description
    List<UIScreen>

    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
    Type Description
    Dictionary<string, UIScreen>

    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
    Type Description
    Dictionary<Type, UIScreen>

    Properties

    IsCollectUIScreensFromSceneOnStart

    If true, OnCreate will collect all UIScreens from the scene using Objecct.FindAllObjectsOfType

    Declaration
    public abstract bool IsCollectUIScreensFromSceneOnStart { get; }
    Property Value
    Type Description
    bool

    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
    Type Description
    UIRoot

    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
    Type Name Description
    IList<UIScreen> screenPrefabs

    CollectUIScreensFromScene()

    Declaration
    protected virtual void CollectUIScreensFromScene()

    CreateScreen(UIScreen)

    Declaration
    public virtual UIScreen CreateScreen(UIScreen screenPrefab)
    Parameters
    Type Name Description
    UIScreen screenPrefab
    Returns
    Type Description
    UIScreen

    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 Description
    TScreen
    Type Parameters
    Name Description
    TScreen

    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
    Name Description
    TScreen

    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
    Type Description
    bool

    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 Description
    TObject
    Type Parameters
    Name Description
    TObject

    GetOrCreateScreen(string)

    Declaration
    public virtual UIScreen GetOrCreateScreen(string screenName)
    Parameters
    Type Name Description
    string screenName
    Returns
    Type Description
    UIScreen

    GetOrCreateScreen(Type)

    Declaration
    public virtual UIScreen GetOrCreateScreen(Type screenType)
    Parameters
    Type Name Description
    Type screenType
    Returns
    Type Description
    UIScreen

    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 Description
    TScreen
    Type Parameters
    Name Description
    TScreen

    GetScreen(string)

    Declaration
    public virtual UIScreen GetScreen(string screenName)
    Parameters
    Type Name Description
    string screenName
    Returns
    Type Description
    UIScreen

    GetScreen(Type)

    Declaration
    public virtual UIScreen GetScreen(Type screenType)
    Parameters
    Type Name Description
    Type screenType
    Returns
    Type Description
    UIScreen

    GetScreenPrefab(string)

    Declaration
    public virtual UIScreen GetScreenPrefab(string screenName)
    Parameters
    Type Name Description
    string screenName
    Returns
    Type Description
    UIScreen

    GetScreenPrefab(Type)

    Declaration
    public virtual UIScreen GetScreenPrefab(Type screenType)
    Parameters
    Type Name Description
    Type screenType
    Returns
    Type Description
    UIScreen

    GetScreenPrefab<TScreen>()

    Declaration
    public virtual TScreen GetScreenPrefab<TScreen>() where TScreen : UIScreen
    Returns
    Type Description
    TScreen
    Type Parameters
    Name Description
    TScreen

    GetScreenPrefab<TScreen>(string)

    Declaration
    public virtual TScreen GetScreenPrefab<TScreen>(string screenName) where TScreen : UIScreen
    Parameters
    Type Name Description
    string screenName
    Returns
    Type Description
    TScreen
    Type Parameters
    Name Description
    TScreen

    GetScreen<TScreen>()

    Gets an existing screen of the specified type if found.

    Declaration
    public virtual TScreen GetScreen<TScreen>() where TScreen : UIScreen
    Returns
    Type Description
    TScreen
    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
    Type Description
    bool

    OnCreate()

    Called when this system is created.

    Declaration
    protected override void OnCreate()
    Overrides
    Unity.Entities.ComponentSystemBase.OnCreate()
    Remarks

    Implement an OnCreate() function to set up system resources when it is created.

    OnCreate is invoked before the the first time Unity.Entities.ComponentSystemBase.OnStartRunning() and OnUpdate are invoked.

    OnUpdate()

    Implement OnUpdate() to perform the major work of this system.

    Declaration
    protected override void OnUpdate()
    Overrides
    Unity.Entities.SystemBase.OnUpdate()
    Remarks

    By default, the system invokes `OnUpdate()` once every frame on the main thread. To skip OnUpdate if all of the system's [EntityQueries] are empty, use the [RequireMatchingQueriesForUpdateAttribute]. To limit when OnUpdate is invoked, you can specify components that must exist, or queries that match specific Entities. To do this, call Unity.Entities.ComponentSystemBase.RequireForUpdate<T>() or Unity.Entities.ComponentSystemBase.RequireForUpdate(Unity.Entities.EntityQuery) in the system's OnCreate method. For more information, see [ShouldRunSystem].

    The [Entities.ForEach] and [Job.WithCode] constructions provide convenient mechanisms for defining jobs. You can also instantiate and schedule an Unity.Entities.IJobChunk instance; you can use the [C# Job System] or you can perform work on the main thread. If you call Unity.Entities.EntityManager methods that perform structural changes on the main thread, be sure to arrange the system order to minimize the performance impact of the resulting [sync points].

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX