mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 11:28:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
34 lines
757 B
C#
34 lines
757 B
C#
namespace Sandbox;
|
|
|
|
[Expose]
|
|
public class Hitbox : IDisposable
|
|
{
|
|
internal Hitbox( GameObject gameObject, ITagSet tagSet, PhysicsBody body )
|
|
{
|
|
GameObject = gameObject;
|
|
Body = body;
|
|
Tags = tagSet;
|
|
|
|
Body.MotionEnabled = false;
|
|
Body.BodyType = PhysicsBodyType.Keyframed;
|
|
Body.Hitbox = this;
|
|
}
|
|
|
|
internal Hitbox( GameObject gameObject, BoneCollection.Bone bone, ITagSet tagSet, PhysicsBody body ) : this( gameObject, tagSet, body )
|
|
{
|
|
Bone = bone;
|
|
}
|
|
|
|
public GameObject GameObject { get; private set; }
|
|
public BoneCollection.Bone Bone { get; private set; }
|
|
public ITagSet Tags { get; private set; }
|
|
public PhysicsBody Body { get; set; }
|
|
internal BBox Bounds { get; set; }
|
|
|
|
public void Dispose()
|
|
{
|
|
Body?.Remove();
|
|
Body = null;
|
|
}
|
|
}
|