Game.Prefabs.MeshSettingsData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
MeshSettingsData is a small ECS component (value type) that holds Entity references to fallback/default meshes used by prefab systems. Each field is an Entity handle (typically to a mesh prefab or mesh section entity). Use this component to provide or query the default/missing meshes for prefabs or net sections during conversion or runtime ECS systems.
Fields
-
public Unity.Entities.Entity m_MissingObjectMesh
Reference to the Entity that represents the mesh used when an expected object mesh is missing. May be Entity.Null when not set. -
public Unity.Entities.Entity m_DefaultBaseMesh
Reference to the Entity that represents a default/base mesh for prefabs. Used as a fallback when no specific base mesh is assigned. -
public Unity.Entities.Entity m_MissingNetSection
Reference to the Entity used as a fallback for missing road/net sections.
Properties
- This struct defines no properties. It exposes only the public fields listed above.
Constructors
public MeshSettingsData()
As a value type, MeshSettingsData has the implicit default constructor which initializes all Entity fields to Entity.Null. There is no custom constructor defined in the source.
Methods
- This struct does not declare any methods.
Usage Example
// Example: creating an entity and attaching MeshSettingsData via EntityManager
using Unity.Entities;
public void CreateMeshSettings(Entity missingObjectMesh, Entity defaultBaseMesh, Entity missingNetSection)
{
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity settingsEntity = entityManager.CreateEntity();
var meshSettings = new MeshSettingsData
{
m_MissingObjectMesh = missingObjectMesh,
m_DefaultBaseMesh = defaultBaseMesh,
m_MissingNetSection = missingNetSection
};
entityManager.AddComponentData(settingsEntity, meshSettings);
}
// Example: reading the component from a system
public partial class MeshSettingsReaderSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<MeshSettingsData>()
.ForEach((in MeshSettingsData ms) =>
{
// use ms.m_MissingObjectMesh, ms.m_DefaultBaseMesh, ms.m_MissingNetSection
}).Schedule();
}
}
Notes: - Entity fields are plain Entity handles — ensure referenced entities exist in the same World and have been created/converted before reading. - Because this is an IComponentData value type, it can be added with EntityManager.AddComponentData or used in conversion/Baker code during authoring.