feat: add initial People Playground mod development kit
This commit is contained in:
122
extracted_wiki_content/internalReference/wirebehaviour.txt
Normal file
122
extracted_wiki_content/internalReference/wirebehaviour.txt
Normal file
@@ -0,0 +1,122 @@
|
||||
URL: https://wiki.studiominus.nl/internalReference/WireBehaviour.html
|
||||
Title: People Playground Modding - WireBehaviour
|
||||
==================================================
|
||||
|
||||
public abstract class WireBehaviour
|
||||
Inherits Hover, Messages.ISlice
|
||||
The base class for all wire behaviours. Handles rendering, physics, and input.
|
||||
Fields
|
||||
public LineRenderer lineRenderer
|
||||
[SkipSerialisation] [HideInInspector]
|
||||
The line renderer used to render the wire.
|
||||
|
||||
public AnchoredJoint2D untypedJoint
|
||||
[SkipSerialisation]
|
||||
The joint. The specific joint type is unknown and is usually exposed by the actual implementation of this class.
|
||||
|
||||
public Transform lineChild
|
||||
[SkipSerialisation] [HideInInspector]
|
||||
The transform of the renderer. This is not the transform of the behaviour itself. The renderer is attached to a child object.
|
||||
|
||||
public PhysicalBehaviour physicalBehaviour
|
||||
The PhysicalBehaviour of the object this behaviour is attached to.
|
||||
|
||||
public PhysicalBehaviour otherPhysicalBehaviour
|
||||
The PhysicalBehaviour on the other end. This is null if the wire is attached to the background.
|
||||
|
||||
protected Vector3[] vertices
|
||||
[SkipSerialisation]
|
||||
The vertices of the visual wire that is rendered.
|
||||
|
||||
protected Vector2[] points2d
|
||||
[SkipSerialisation]
|
||||
The 2D vertices of the visual wire that is rendered.
|
||||
|
||||
public Vector2 Joint_ConnectedAnchor
|
||||
[System.Obsolete]
|
||||
The connected anchor of the joint as given by the tool behaviour. It is obsolete and does nothing.
|
||||
|
||||
public Vector2 Joint_Anchor
|
||||
[System.Obsolete]
|
||||
The local anchor of the joint as given by the tool behaviour. It is obsolete and does nothing.
|
||||
|
||||
public Material WireMaterial
|
||||
[SkipSerialisation]
|
||||
The material for the renderer.
|
||||
|
||||
public float WireWidth
|
||||
The width of the wire.
|
||||
|
||||
public Color WireColor
|
||||
The colour of the wire used by the renderer.
|
||||
|
||||
public readonly Color LegacyColour
|
||||
[SkipSerialisation]
|
||||
The colour of a wire from an older version of the game. Used for deserialisation.
|
||||
|
||||
public string WireMaterialName
|
||||
The Resource name for the material. Used for serialisation and deserialisation. Disgusting.
|
||||
|
||||
protected bool shouldIgnoreUpdate
|
||||
[SkipSerialisation]
|
||||
Should the wire update at all? This is a redundant member that exists just to guarantee that nothing is updated when the wire is about to be destroyed.
|
||||
|
||||
protected bool usedToHaveConnectedBody
|
||||
Did this wire have a connected body at some point?
|
||||
|
||||
protected Vector2 currentConnectedAnchor
|
||||
The connected anchor of the joint .
|
||||
|
||||
protected Vector2 currentAnchor
|
||||
The local anchor of the joint as given by the tool behaviour.
|
||||
|
||||
public float currentBreakingForce
|
||||
The current breaking force of the joint as given by the tool behaviour.
|
||||
|
||||
public static Dictionary<PhysicalBehaviour, List<WireBehaviour>> WireDictionary
|
||||
No description provided
|
||||
|
||||
Properties
|
||||
protected EdgeCollider2D EdgeCollider
|
||||
[SkipSerialisation] [System.Obsolete]
|
||||
The generated edge collider.
|
||||
|
||||
Methods
|
||||
public virtual int GetVertexCount()
|
||||
Should return the amount of vertices in the wire. 12 by default. Meant to be implemented by the actual implementation.
|
||||
|
||||
protected void Initialise()
|
||||
Initialises objects that need to exist.
|
||||
|
||||
protected virtual void Update()
|
||||
The base class updates the renderer and handles input.
|
||||
|
||||
public override void OnMouseOverlapEvent(bool overlap)
|
||||
No description provided
|
||||
|
||||
protected override void OnDestroy()
|
||||
No description provided
|
||||
|
||||
public virtual void Slice()
|
||||
A message receiver that is called by things like lasers and Beamrifles. It disconnects the joint and destroys the wire.
|
||||
|
||||
public void SetColor(Color color)
|
||||
Forcefully sets the wire colour. May not work for some implementations.
|
||||
|
||||
public void SetThickness(float thickness)
|
||||
Forcefully sets the wire thickness. May not work for some implementations.
|
||||
|
||||
protected override Bounds GetVisualBounds()
|
||||
No description provided
|
||||
|
||||
protected override bool IsMouseInsideCollider()
|
||||
No description provided
|
||||
|
||||
protected virtual void JointBroken()
|
||||
Is called when the joint breaks. Base class does nothing.
|
||||
|
||||
protected virtual void Tick()
|
||||
Is called every fixed update step. Base class does nothing.
|
||||
|
||||
protected virtual void Created()
|
||||
Is called when the wire is created. Base class does nothing.
|
||||
Reference in New Issue
Block a user