Class RubbleObject
Represents rubble object. These objects are physicly simulated some time and frozen after that. It's done for optimization reasons so rubbles not gonna be simulated forever.
Inheritance
System.Object
RubbleObject
Assembly: Eco.Gameplay.dll
Syntax
[ChatCommandHandler]
public abstract class RubbleObject : Object, INetObjectPosition, IPositionAndBounds, IFreezable, INetObject, IEcoObject, IPickupable, IHasInteractions
Constructors
RubbleObject()
Declaration
Fields
MaxAmountPerBlock
Declaration
public const int MaxAmountPerBlock = 4
Field Value
Type |
Description |
System.Int32 |
|
Properties
Active
Declaration
public bool Active { get; }
Property Value
Type |
Description |
System.Boolean |
|
Bounds
Declaration
public Rect Bounds { get; }
Property Value
GroundDistance
Declaration
public float GroundDistance { get; set; }
Property Value
Type |
Description |
System.Single |
|
ID
Declaration
Property Value
Type |
Description |
System.Int32 |
|
IsBreakable
Declaration
public bool IsBreakable { get; }
Property Value
Type |
Description |
System.Boolean |
|
NetEntity
Declaration
public NetPhysicsEntity NetEntity { get; }
Property Value
NetObjectCreationRealtime
Declaration
public double NetObjectCreationRealtime { get; set; }
Property Value
Type |
Description |
System.Double |
|
PickingUp
This flag should be set when rubble is picking up to prevent concurrent picking same rubble. If you can't set this flag then usually you just need to skip the rubble.
Declaration
public ref ConcurrentFlag PickingUp { get; }
Property Value
Position
Declaration
public Vector3 Position { get; set; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
Rotation
Declaration
public Quaternion Rotation { get; set; }
Property Value
SpawnOffset
Declaration
public virtual Vector3 SpawnOffset { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
SubRubbleTypes
Declaration
public Type[] SubRubbleTypes { get; }
Property Value
Type |
Description |
System.Type[] |
|
UpdateChannel
Declaration
public NetworkChannel UpdateChannel { get; }
Property Value
Methods
BecomesRubble(Type)
Declaration
public static bool BecomesRubble(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
Breakup(Player)
Breaks the chunk of rubble into pieces
Declaration
public List<RubbleObject> Breakup(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Returns
Type |
Description |
System.Collections.Generic.List<RubbleObject> |
List of the rubble pieces
|
ClearRubble(User, Single)
Declaration
[ChatSubCommand]
public static void ClearRubble(User user, float radius = 10F)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Single |
radius |
|
Destroy()
Declaration
GetRandomRubble(Type)
Returns random rubble type from block's meta info if it exists.
Declaration
public static Type GetRandomRubble(Type blockType)
Parameters
Type |
Name |
Description |
System.Type |
blockType |
|
Returns
Type |
Description |
System.Type |
|
IsNotRelevant(INetObjectViewer)
Declaration
public bool IsNotRelevant(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsRelevant(INetObjectViewer)
Declaration
public bool IsRelevant(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsUpdated(INetObjectViewer)
Declaration
public bool IsUpdated(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Pickup(Player, InteractionTarget, Inventory, INetObject)
Declaration
public abstract Task<bool> Pickup(Player player, InteractionTarget target, Inventory targetInv, INetObject toolUsed)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
ReceiveInitialState(BSONObject)
Declaration
public void ReceiveInitialState(BSONObject bsonObj)
Parameters
ReceiveUpdate(BSONObject)
Declaration
public void ReceiveUpdate(BSONObject bsonObj)
Parameters
SendInitialState(BSONObject, INetObjectViewer)
Declaration
public void SendInitialState(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
SendUpdate(BSONObject, INetObjectViewer)
Declaration
public void SendUpdate(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
SpawnRubble(User, String, Int32)
Declaration
[ChatSubCommand]
public static void SpawnRubble(User user, string blockTypeName = "Granite", int rubble = 32)
Parameters
Type |
Name |
Description |
User |
user |
|
System.String |
blockTypeName |
|
System.Int32 |
rubble |
|
TrySpawnFromBlock(Player, Type, Vector3, Int32)
Declaration
public static bool TrySpawnFromBlock(Player player, Type blockType, Vector3 position, int forced = -1)
Parameters
Type |
Name |
Description |
Player |
player |
|
System.Type |
blockType |
|
System.Numerics.Vector3 |
position |
|
System.Int32 |
forced |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
Extension Methods