Class CreateSamplesUserToolsDataSystem
System to create user tools data for the samples.
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.Samples.Systems
Assembly: FwtHexTerrainSamples.dll
Syntax
[UpdateInGroup(typeof(CreateHexTerrainsGroup))]
public class CreateSamplesUserToolsDataSystem : CreateUserToolsDataSystem<SamplesUserToolsData, CreateSamplesUserToolsDataRequest>
Fields
_samplesUISystem
Declaration
protected SamplesUISystem _samplesUISystem
Field Value
| Type | Description |
|---|---|
| SamplesUISystem |
_userToolsScreen
Declaration
protected UserToolsScreen _userToolsScreen
Field Value
| Type | Description |
|---|---|
| UserToolsScreen |
Properties
SamplesUISystem
Cached reference to the UI System;
Declaration
public SamplesUISystem SamplesUISystem { get; }
Property Value
| Type | Description |
|---|---|
| SamplesUISystem |
UserToolsScreen
Cached version of the UserToolScreen.
Declaration
public UserToolsScreen UserToolsScreen { get; }
Property Value
| Type | Description |
|---|---|
| UserToolsScreen |
Methods
CreateUISystemAPI(Entity, Entity, CreateSamplesUserToolsDataRequest)
Creates the API object for the user tools state. User tools use this object to request a terrain data as well as to send a requests to the UI system.
Declaration
protected override IUISystemAPI CreateUISystemAPI(Entity userToolsEntity, Entity terrainEntity, CreateSamplesUserToolsDataRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| Entity | userToolsEntity | |
| Entity | terrainEntity | Terrain entity |
| CreateSamplesUserToolsDataRequest | request | request to create a UserToolsData |
Returns
| Type | Description |
|---|---|
| IUISystemAPI | reference to the object that implements the IUISystemAPI interface and allows to send commands to the UI system |
Overrides
CreateUserToolAPI(Entity, Entity, CreateSamplesUserToolsDataRequest)
Declaration
protected override IHexTerrainAPI CreateUserToolAPI(Entity userToolsEntity, Entity terrainEntity, CreateSamplesUserToolsDataRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| Entity | userToolsEntity | |
| Entity | terrainEntity | |
| CreateSamplesUserToolsDataRequest | request |
Returns
| Type | Description |
|---|---|
| IHexTerrainAPI |
Overrides
CreateUserToolsData(Entity, Entity, CreateSamplesUserToolsDataRequest)
Creates the user tools data object.
Declaration
protected override SamplesUserToolsData CreateUserToolsData(Entity userToolsEntity, Entity terrainEntity, CreateSamplesUserToolsDataRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| Entity | userToolsEntity | |
| Entity | terrainEntity | terrain entity the user tools data will be created for |
| CreateSamplesUserToolsDataRequest | request | request to create a user tools data |
Returns
| Type | Description |
|---|---|
| SamplesUserToolsData | reference to the created user tools data |
Overrides
OnCreateForCompiler()
Declaration
protected override void OnCreateForCompiler()
Overrides
OnUpdate()
Implement OnUpdate() to perform the major work of this system.
Declaration
protected override void OnUpdate()
Overrides
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].
SetHeightmapsPaletteToUserTools(SamplesUserToolsData, DynamicBuffer<HeightmapsPalette>)
Sets the heightmaps palette to the user tools data. Heightmaps are applied to the terrain at ApplyHeightmapUserTool.
Declaration
protected virtual void SetHeightmapsPaletteToUserTools(SamplesUserToolsData userToolsData, DynamicBuffer<HeightmapsPalette> heightmapsPalette)
Parameters
| Type | Name | Description |
|---|---|---|
| SamplesUserToolsData | userToolsData | |
| DynamicBuffer<HeightmapsPalette> | heightmapsPalette |