Skip to content

Game.Rendering.PropertyData

Assembly: Assembly-CSharp.dll
Namespace: Game.Rendering

Type: struct

Base: System.ValueType

Summary:
A small value-type used by the rendering system to associate a shader/property name (as an integer id) with an index into a per-frame or per-object property data array or buffer. Instances are plain data holders (POD) and are intended to be passed/stored by value for fast access in rendering code.


Fields

  • public int m_NameID
    Holds the shader/property id (typically obtained via UnityEngine.Shader.PropertyToID). Identifies which shader property this entry refers to.

  • public int m_DataIndex
    Index into a property-data array, buffer, or table used by the renderer to read/write the actual value associated with m_NameID.

Properties

  • This struct does not define any C# properties; it exposes two public fields (m_NameID and m_DataIndex) that are accessed directly.

Constructors

  • This struct has the implicit default constructor provided by C# (zero-initializes fields). You can also initialize it with an object initializer:
  • var pd = new PropertyData { m_NameID = id, m_DataIndex = idx };

Methods

  • None. PropertyData is a plain data container with no behavior.

Usage Example

using UnityEngine;
using Game.Rendering;

// Create a PropertyData referencing a shader property and a data slot
PropertyData pd = new PropertyData
{
    m_NameID = Shader.PropertyToID("_MainTex"),
    m_DataIndex = 2
};

// Example use in renderer code (pseudo):
// var value = propertyDataArray[pd.m_DataIndex];
// material.SetTexture(pd.m_NameID, value as Texture);