Game.ObjectSubAreaInfo
Assembly:
(unknown; typically Assembly-CSharp in Unity projects)
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
Represents a sub-area definition used by object prefabs. This class stores a reference to the parent AreaPrefab and arrays that describe node positions (in local space) and the parent-mesh indices for those nodes. It is marked serializable so it can be persisted by Unity/the game's prefab system and exposes metadata attributes to drive in-editor input validation.
Fields
-
public AreaPrefab m_AreaPrefab
Reference to the AreaPrefab this sub-area belongs to. Used to associate sub-area geometry and settings with the higher-level area definition. -
public float3[] m_NodePositions
Array of node positions (Unity.Mathematics.float3) that define the sub-area shape/outline in local coordinates. Decorated with: [InputField]
— indicates this field is editable via the game's prefab editor/inspector UI.[RangeN(-10000f, 10000f, true)]
— each component of the float3 values is expected to lie within -10000..10000. The boolean flag typically indicates the editor should validate or clamp values to this range.
Note: The length of this array determines how many nodes the sub-area has; coordinates are usually in local object space.
public int[] m_ParentMeshes
Parallel array of integers indicating which parent mesh each node belongs to. The array is expected to correspond 1:1 with m_NodePositions (same length). Values are generally indices into the prefab's mesh list or sub-mesh identifiers.
Properties
- None
Constructors
public ObjectSubAreaInfo()
Default parameterless constructor (implicit). Instances are typically created and then populated by the prefab loader/editor or by mod code constructing prefab data.
Methods
- None
Usage Example
using Unity.Mathematics;
using Game.Prefabs;
// create and populate a sub-area for a prefab
var subArea = new ObjectSubAreaInfo();
subArea.m_AreaPrefab = someAreaPrefabReference;
subArea.m_NodePositions = new float3[]
{
new float3(-1f, 0f, -1f),
new float3( 1f, 0f, -1f),
new float3( 1f, 0f, 1f),
new float3(-1f, 0f, 1f)
};
// for example: all nodes belong to mesh 0
subArea.m_ParentMeshes = new int[] { 0, 0, 0, 0 };
// then assign into the parent prefab structure or serialize as needed
Notes for modders: - Ensure m_NodePositions and m_ParentMeshes have matching lengths. - Values in m_NodePositions should respect the RangeN limits to avoid editor validation issues. - Because the class is [Serializable], it can be serialized into prefab assets or edited by in-game tools; use the InputField-decorated members to expose editable data in mod editors.