Class BlockScript
Base class for custom BlockBehaviours. It offers various callbacks and convenience properties to assist in writing the code for your blocks.
Inherited Members
Namespace: Modding
Assembly: Assembly-CSharp.dll
Syntax
public class BlockScript : ModBlockBehaviour, ILimitsDisplay
Remarks
The documentation for callbacks contains information about their behaviour in multiplayer. When writing your block script, keep in mind that most callbacks are also called if the game instance the script is running on does not handle physics currently.
You can use the SimPhysics
property to determine whether you should handle physics,
or use methods that are only called if physics should / should not be simulated.
Constructors
BlockScript()
Declaration
public BlockScript()
Methods
GetLimitsDisplay()
Declaration
public virtual Transform GetLimitsDisplay()
Returns
Type | Description |
---|---|
UnityEngine.Transform |
OnFlip()
Override to implement custom flipping behaviour on the block. Return value indicates whether the block was actually flipped, returning true causes the direction arrow to be flipped, if it is present.
Overriding this means the CanFlip XML element has no effect anymore.
Declaration
public virtual bool OnFlip()
Returns
Type | Description |
---|---|
Boolean |
Remarks
If you just want to change behaviour of the block based on whether it is currently flipped, also consider using the Flipped property instead.