Skip to content

Game.Prefabs.RenderPrefabBase

Assembly:
Namespace: Game.Prefabs

Type: abstract class

Base: PrefabBase

Summary:
RenderPrefabBase is an abstract marker/base class for prefab types that are related to rendering in the engine. It doesn't declare any members itself; it exists to group and identify prefab implementations that provide rendering-related behavior or data. Subclasses should extend PrefabBase and implement the concrete functionality required by the rendering subsystem or the mod (for example, providing meshes, materials, or render-time configuration).


Fields

  • This class declares no fields.
    {{ The class file contains no field declarations. Any data for render prefabs should be provided by concrete subclasses or by the PrefabBase base class. }}

Properties

  • This class declares no properties.
    {{ Provide properties on derived classes as needed (for example references to Mesh, Material, LOD settings, etc.). }}

Constructors

  • public RenderPrefabBase()
    {{ The class does not explicitly define a constructor, so the compiler provides the default parameterless constructor. Because the class is abstract it cannot be instantiated directly — derived classes will call this base constructor. }}

Methods

  • This class declares no methods.
    {{ All behavior must be implemented in subclasses or inherited from PrefabBase. Typical overrides will depend on the members exposed by PrefabBase (initialization hooks, serialization, validation, etc.). }}

Usage Example

// Example of a minimal concrete render prefab deriving from RenderPrefabBase.
// Implement the members required by PrefabBase to provide your render data.

namespace Game.Prefabs
{
    public class MyRenderPrefab : RenderPrefabBase
    {
        // Add fields/properties for mesh, material, LODs, etc.
        // Override PrefabBase virtual methods here to initialize and register render assets.

        // Example placeholder constructor
        public MyRenderPrefab()
        {
            // Initialization logic for this prefab
        }

        // Example hypothetical override (actual method names depend on PrefabBase)
        // protected override void OnInitialize() { ... }
    }
}

{{ Tips: - Use RenderPrefabBase as a clear semantic base for prefabs whose primary role is rendering. - Keep rendering data (meshes, materials, LODs) in the concrete subclass. This keeps RenderPrefabBase lightweight and focused on classification. - Check PrefabBase for lifecycle methods (creation, loading, serialization) you will typically override when implementing a concrete render prefab. - When modding Cities: Skylines 2, follow the game/mod SDK conventions for registering and loading prefabs (PrefabCollection or equivalent) so the engine can find and use your render prefabs at runtime. }}