Skip to content

OnStructureRotate

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnStructureRotate( BuildingBlock instance, BasePlayer player )
{
    Puts( "OnStructureRotate works!" );
    return null;
}

Location

  • BuildingBlock::DoRotation(BaseEntity.RPCMessage msg)
csharp
[RPC_Server]
[RPC_Server.MaxDistance(3f)]
private void DoRotation(RPCMessage msg)
{
	if (msg.player.CanInteract() && CanRotate(msg.player) && blockDefinition.canRotateAfterPlacement && Interface.CallHook("OnStructureRotate", this, msg.player) == null)
	{
		base.transform.localRotation *= Quaternion.Euler(blockDefinition.rotationAmount);
		RefreshEntityLinks();
		UpdateSurroundingEntities();
		UpdateSkin(force: true);
//---

Released under the MIT License.