Skip to main content

Part

A class in Root.Township, Alta.PAGaC.

A prefab piece for the PAGaC procedural building generator, with the rule that says where it can go and its offset inside a grid cell. A ScriptableObject asset.

Constructors​

MemberWhat it is
Part()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

5 private and internal fields
MemberWhat it is
private Vector3 positionBacking field for Position.
private GameObject prefabBacking field for Prefab.
private Vector3 rotationBacking field for Rotation.
private Rule ruleBacking field for Rule.
private Vector3 scaleBacking field for Scale.

Properties​

MemberWhat it is
Vector3 Position { get; }Local offset of the prefab inside its cell, rotated with the placement.
GameObject Prefab { get; }Prefab that Constructor instantiates where the rule fits.
Vector3 Rotation { get; }Extra Euler rotation applied on top of the placement's 90 degree turn.
Rule Rule { get; }Grid rule that decides where this part can be placed.
Vector3 Scale { get; }Local scale given to each instantiated prefab.

Used in​

Members of other types that take, return or hold a Part: