Class BuildingUtilities
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
gameObjectGameObjectThe GameObject to add the obstacle to
carvingboolWhether the obstacle should carve the NavMesh
carveOnlyStationaryboolWhether to only carve when stationary
AddNavMeshObstacles(GameObject[], bool)
Add NavMesh obstacles to multiple GameObjects
public static void AddNavMeshObstacles(GameObject[] gameObjects, bool carving = true)
Parameters
gameObjectsGameObject[]carvingbool
ApplyOcclusionSettings(GameObject, bool)
Apply occlusion settings to all renderers in a GameObject
public static void ApplyOcclusionSettings(GameObject gameObject, bool allowOcclusion)
Parameters
gameObjectGameObjectallowOcclusionbool
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
Returns
CreateFolder(string, Transform?)
Create an empty GameObject to serve as a folder/container
public static GameObject CreateFolder(string name, Transform? parent = null)
Parameters
namestringparentTransform
Returns
- GameObject
RemoveColliders(GameObject, bool)
Remove all colliders from a GameObject
public static void RemoveColliders(GameObject gameObject, bool includeChildren = false)
Parameters
gameObjectGameObjectincludeChildrenbool
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
gameObjectGameObject