Show / Hide Table of Contents

Class RoomTemplateLoaderGrid3D

Inheritance
System.Object
RoomTemplateLoaderGrid3D
Namespace: Edgar.Unity
Assembly: cs.temp.dll.dll
Syntax
public class RoomTemplateLoaderGrid3D

Methods

GetBlocks(GameObject, RoomTemplateSettingsGrid3D)

Gets all the blocks from which this room template is made of.

Declaration
public static HashSet<Vector3Int> GetBlocks(GameObject roomTemplate, RoomTemplateSettingsGrid3D roomTemplateSettings)
Parameters
Type Name Description
GameObject roomTemplate
RoomTemplateSettingsGrid3D roomTemplateSettings
Returns
Type Description
HashSet<Vector3Int>

GetBlocksFromBlocks(GameObject, RoomTemplateSettingsGrid3D)

Gets blocks from explicit BlockMarkerGrid3D markers.

Declaration
public static HashSet<Vector3Int> GetBlocksFromBlocks(GameObject roomTemplate, RoomTemplateSettingsGrid3D roomTemplateSettings)
Parameters
Type Name Description
GameObject roomTemplate
RoomTemplateSettingsGrid3D roomTemplateSettings
Returns
Type Description
HashSet<Vector3Int>

GetBlocksFromMeshes(GameObject, RoomTemplateSettingsGrid3D)

Gets blocks from meshes found in the room template.

Declaration
public static HashSet<Vector3Int> GetBlocksFromMeshes(GameObject roomTemplate, RoomTemplateSettingsGrid3D roomTemplateSettings)
Parameters
Type Name Description
GameObject roomTemplate
RoomTemplateSettingsGrid3D roomTemplateSettings
Returns
Type Description
HashSet<Vector3Int>

GetBlocksRoot(GameObject)

Gets the root object that contains blocks in the room template.

Declaration
public static GameObject GetBlocksRoot(GameObject roomTemplate)
Parameters
Type Name Description
GameObject roomTemplate
Returns
Type Description
GameObject

GetOutline(GameObject)

Computes the outline of the room template.

Declaration
public static PolygonGrid2D GetOutline(GameObject roomTemplate)
Parameters
Type Name Description
GameObject roomTemplate
Returns
Type Description
PolygonGrid2D

Throws if outline is not valid.

GetPolygonFromTiles(HashSet<EdgarVector2Int>, PolygonOutlineModeGrid3D)

A more general version of the 2D algorithm that can also work with outlines made of Points (rather than tiles).

Declaration
public static PolygonGrid2D GetPolygonFromTiles(HashSet<EdgarVector2Int> points, PolygonOutlineModeGrid3D outlineMode = PolygonOutlineModeGrid3D.Points)
Parameters
Type Name Description
HashSet<EdgarVector2Int> points
PolygonOutlineModeGrid3D outlineMode
Returns
Type Description
PolygonGrid2D

TryGetDoors(GameObject, PolygonGrid2D, out DoorLoadingResultGrid3D)

Tries to get the doors of the room template.

Declaration
public static bool TryGetDoors(GameObject roomTemplatePrefab, PolygonGrid2D checkDoorsAgainstOutline, out DoorLoadingResultGrid3D result)
Parameters
Type Name Description
GameObject roomTemplatePrefab
PolygonGrid2D checkDoorsAgainstOutline
DoorLoadingResultGrid3D result
Returns
Type Description
System.Boolean
Remarks

Use the checkDoorsAgainstOutline argument if you want to check individual doors against the room template outline. Use null for the outline otherwise.

By doing it this way, we can check the error status of individual room templates rather than having a generic message.

TryGetRoomTemplate(GameObject, Nullable<Boolean>, Boolean, Boolean, out RoomTemplateGrid2D, out ActionResult)

Computes a room room template from a given room template game object.

Declaration
public static bool TryGetRoomTemplate(GameObject roomTemplatePrefab, bool? allowRotationOverride, bool checkOrigin, bool handleComputationMode, out RoomTemplateGrid2D roomTemplate, out ActionResult result)
Parameters
Type Name Description
GameObject roomTemplatePrefab
System.Nullable<System.Boolean> allowRotationOverride
System.Boolean checkOrigin
System.Boolean handleComputationMode
RoomTemplateGrid2D roomTemplate
ActionResult result
Returns
Type Description
System.Boolean
In This Article
Back to top Generated by DocFX