Table of Contents

Class PrimitiveBuilder

Namespace
S1MAPI.ProceduralMesh
Assembly
S1MAPI_Mono.dll

Helper for creating and configuring Unity primitive GameObjects Based on patterns from PetShopSpawner

public static class PrimitiveBuilder
Inheritance
PrimitiveBuilder
Inherited Members

Methods

CreateBox(string, Vector3, Vector3, Color, Transform?)

Create a box primitive (convenience method)

public static GameObject CreateBox(string name, Vector3 localPosition, Vector3 size, Color color, Transform? parent = null)

Parameters

name string
localPosition Vector3
size Vector3
color Color
parent Transform

Returns

GameObject

CreateCylinder(string, Vector3, Vector3, Color, Transform?)

Create a cylinder primitive (convenience method)

public static GameObject CreateCylinder(string name, Vector3 localPosition, Vector3 size, Color color, Transform? parent = null)

Parameters

name string
localPosition Vector3
size Vector3
color Color
parent Transform

Returns

GameObject

CreatePointLight(string, Vector3, Color, float, float, Transform?, LightShadows, LightRenderMode)

Create a point light with URP-correct defaults matching Schedule I's pipeline.

public static GameObject CreatePointLight(string name, Vector3 localPosition, Color color, float range, float intensity, Transform? parent = null, LightShadows shadows = LightShadows.None, LightRenderMode renderMode = LightRenderMode.ForcePixel)

Parameters

name string

GameObject name

localPosition Vector3

Local position relative to parent

color Color

Light color

range float

Light range in meters

intensity float

Light intensity

parent Transform

Optional parent transform

shadows LightShadows

Shadow mode (default: None to match game's URP settings)

renderMode LightRenderMode

Render mode (default: ForcePixel for URP per-pixel lighting)

Returns

GameObject

CreatePrefab(string, string, Vector3, Quaternion, Transform?)

Create a prefab instance from a loaded resource or existing object

public static GameObject CreatePrefab(string prefabName, string name, Vector3 localPosition, Quaternion localRotation, Transform? parent = null)

Parameters

prefabName string

Name of the prefab to find/load

name string

Name for the instance

localPosition Vector3

Local position relative to parent

localRotation Quaternion

Local rotation

parent Transform

Optional parent transform

Returns

GameObject

The created GameObject instance or null if not found

CreatePrimitive(PrimitiveType, string, Vector3, Vector3, Color, float, Transform?)

Create a primitive with scaled dimensions

public static GameObject CreatePrimitive(PrimitiveType type, string name, Vector3 localPosition, Vector3 localScale, Color color, float scale, Transform? parent = null)

Parameters

type PrimitiveType

The type of primitive to create

name string

Name for the GameObject

localPosition Vector3

Local position relative to parent

localScale Vector3

Local scale

color Color

Base color for the material

scale float

Global scale multiplier

parent Transform

Optional parent transform

Returns

GameObject

The created GameObject

CreatePrimitive(PrimitiveType, string, Vector3, Vector3, Color, Transform?)

Create a Unity primitive GameObject with material and optional parent

public static GameObject CreatePrimitive(PrimitiveType type, string name, Vector3 localPosition, Vector3 localScale, Color color, Transform? parent = null)

Parameters

type PrimitiveType

The type of primitive to create

name string

Name for the GameObject

localPosition Vector3

Local position relative to parent

localScale Vector3

Local scale

color Color

Base color for the material

parent Transform

Optional parent transform

Returns

GameObject

The created GameObject

CreateSphere(string, Vector3, float, Color, Transform?)

Create a sphere primitive (convenience method)

public static GameObject CreateSphere(string name, Vector3 localPosition, float radius, Color color, Transform? parent = null)

Parameters

name string
localPosition Vector3
radius float
color Color
parent Transform

Returns

GameObject

SetupMaterial(Renderer, string, Color)

Setup material for a renderer based on the object name and color Automatically determines if the material should be transparent (glass/window)

public static void SetupMaterial(Renderer renderer, string name, Color color)

Parameters

renderer Renderer

The renderer to configure

name string

Name of the object (used to determine material type)

color Color

Base color