Game.Prefabs.ObjectMeshInfo
Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
Represents a single mesh instance configuration for an in-game object prefab. This serializable container stores a reference to a render prefab, a local position and rotation (using Unity.Mathematics types), and an optional required object state. Editor attributes are present to control how the fields are exposed in the game's modding/editor UI (e.g., InputField and a clamped RangeN for position).
Fields
-
public RenderPrefabBase m_Mesh
Reference to the render prefab used for this mesh instance. RenderPrefabBase is defined in Game.Objects and typically points to the mesh/visual representation to use. -
public float3 m_Position
Local position of the mesh instance (Unity.Mathematics.float3). Decorated with: [InputField]
— indicates it should be editable in the editor UI.-
[RangeN(-10000f, 10000f, true)]
— a custom range attribute that clamps/limits values in the editor (range -10000 to 10000, likely applied per-component). Use this to position the mesh relative to its parent/pivot. -
public quaternion m_Rotation = quaternion.identity
Local rotation of the mesh instance (Unity.Mathematics.quaternion). Defaults to identity (no rotation). -
public ObjectState m_RequireState
Optional requirement for the object's state; the mesh may be intended to appear only when the object is in this state. ObjectState is defined in Game.Objects (or a related namespace).
Properties
- (None declared)
This class only exposes public fields; there are no C# properties defined in the source.
Constructors
public ObjectMeshInfo()
Default parameterless constructor is provided implicitly by the compiler. It initializes m_Rotation to quaternion.identity; other fields default to null/zero values.
Methods
- (None declared)
No methods are defined on this type; it acts as a simple data container/DTO for serialization and editor exposure.
Usage Example
using Game.Prefabs;
using Game.Objects;
using Unity.Mathematics;
// Create and configure a mesh instance for a prefab
var meshInfo = new ObjectMeshInfo
{
m_Mesh = myRenderPrefab, // RenderPrefabBase instance from your prefab assets
m_Position = new float3(0f, 1.5f, 0f), // local offset
m_Rotation = quaternion.EulerXYZ(new float3(0f, math.radians(90f), 0f)),
m_RequireState = ObjectState.Active // example enum value; use the appropriate state
};
Notes - The class is marked [Serializable], so it is intended for serialization (prefab data files, saved settings, editor panels). - Attributes such as [InputField] and [RangeN] are editor/UI hints used by the game's modding/editor system — their exact behavior depends on the editor implementation. - Uses Unity.Mathematics types (float3, quaternion) for deterministic, burst-friendly math; convert to UnityEngine types if required for runtime APIs.