Table of Contents

Class BuildingUtilities

Namespace
S1MAPI.Building
Assembly
S1MAPI_Mono.dll

Utility functions for building construction and configuration

public static class BuildingUtilities
Inheritance
BuildingUtilities
Inherited Members

Methods

AddNavMeshObstacle(GameObject, bool, bool)

Add a NavMesh obstacle to a GameObject

public static void AddNavMeshObstacle(GameObject gameObject, bool carving = true, bool carveOnlyStationary = false)

Parameters

gameObject GameObject

The GameObject to add the obstacle to

carving bool

Whether the obstacle should carve the NavMesh

carveOnlyStationary bool

Whether to only carve when stationary

AddNavMeshObstacles(GameObject[], bool)

Add NavMesh obstacles to multiple GameObjects

public static void AddNavMeshObstacles(GameObject[] gameObjects, bool carving = true)

Parameters

gameObjects GameObject[]
carving bool

ApplyOcclusionSettings(GameObject, bool)

Apply occlusion settings to all renderers in a GameObject

public static void ApplyOcclusionSettings(GameObject gameObject, bool allowOcclusion)

Parameters

gameObject GameObject
allowOcclusion bool

ComputeGridCellSize(float, float)

Compute the grid cell size for a room with the given dimensions. Returns the largest square cell size ≤ S1MAPI.Utils.Constants.Spatial.DefaultGridSize that evenly divides the room's X axis. The pathfinding grid uses this same value so furniture placement and NPC navigation are always aligned.

public static float ComputeGridCellSize(float roomX, float roomZ)

Parameters

roomX float
roomZ float

Returns

float

CreateFolder(string, Transform?)

Create an empty GameObject to serve as a folder/container

public static GameObject CreateFolder(string name, Transform? parent = null)

Parameters

name string
parent Transform

Returns

GameObject

RemoveColliders(GameObject, bool)

Remove all colliders from a GameObject

public static void RemoveColliders(GameObject gameObject, bool includeChildren = false)

Parameters

gameObject GameObject
includeChildren bool

SetupCollider(GameObject)

Setup collider for a primitive based on naming conventions Removes colliders from decorative or fallback objects

public static void SetupCollider(GameObject gameObject)

Parameters

gameObject GameObject