JointPoint
An abstract class in Root.Township, Alta.Crafting.
Base for the two ends of a crafting join: JointSlot (receives) and the insert (goes in). It tracks whether it is connected, shows a glow, and switches objects on or off when joined.
- Listed in Crafting and making
- Inherits or implements
NetworkEntityBehaviour - Derived types
JointInsert,JointPointEvent,JointPointUnityEvent,JointSlot - Documented in Crafting
Constructors
| Member | What it is |
|---|---|
protected JointPoint() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private JointPointEvent connected | Event behind Connected, invoked by OnJointConnected. |
private List<GameObject> connectedObjects | Objects shown only while the joint is connected. |
private CraftingPart craftingPart | Backing field for CraftingPart, found in the parents on first use. |
private JointPointEvent disconnected | Event behind Disconnected, invoked by OnJointDisconnected. |
private List<GameObject> disconnectedObjects | Objects shown only while the joint is disconnected. |
private Renderer glow | Renderer that glows to show the joint. OnValidate finds a child named Glow if unset. |
private static readonly int glowColor | Shader property ID for the glow colour (_EmisColor). |
private MaterialPropertyBlock glowProperties | Material property block used to set the glow colour. |
private static Logger logger | NLog logger for this class. |
Properties
| Member | What it is |
|---|---|
CraftingPart CraftingPart { get; } | The crafting part this joint belongs to, found in parents. |
abstract IEnumerable<JointPointType> GeneralTypes { get; } | The joint's types, used to match slots and inserts. |
Transform Glow { get; } | Transform of the glow renderer. |
bool IsConnected { get; private set; } | True while joined. |
bool IsGlowing { get; set; } | Shows or hides the glow. Always false on a headless server. |
bool IsPreConfirmationConnected { get; private set; } | True while a join is waiting for confirmation (such as nailing). |
Events
| Member | What it is |
|---|---|
event Action<JointPoint> Connected | Raised when the joint connects. |
event Action<JointPoint> Disconnected | Raised when the joint disconnects. |
event IsJointAvailable isAvailable | Lets other code veto IsAvailable. |
Methods
1 private and internal method
Used in
Members of other types that take, return or hold a JointPoint: