Collider
namespace Griff.Scenes;
public abstract class Collider : ComponentA shape for collisions: a BoxCollider, a CircleCollider or a PolygonCollider. Without a Body the shape is static: walls, floors, platforms. Use GetComponent<Collider>() to find any kind.
Properties
Section titled “Properties”IgnoreLayers
Section titled “IgnoreLayers”public abstract string? IgnoreLayers { get; set; }Layers this collider passes through, e.g. “Bullet, Enemy”: no blocking, no collisions, no triggers. It works both ways, so only one side has to list the other.
IsTrigger
Section titled “IsTrigger”public abstract bool IsTrigger { get; set; }Triggers don’t block movement; they report OnTriggerEnter/Exit instead.
public abstract string? Layer { get; set; }A name for what kind of thing this is, e.g. “Player”, “Enemy” or “Bullet”, for IgnoreLayers and physics queries. Empty is the “Default” layer.
Offset
Section titled “Offset”public abstract Vector2 Offset { get; set; }How far the shape’s center is from the entity, before the transform’s scale.
public bool Turns { get; }True when the shape turns with its entity: its Body (the entity’s own, or else the nearest one it’s inside) Rotates. Otherwise it stays upright whatever the entity’s rotation, as colliders always have.
WorldBounds
Section titled “WorldBounds”public abstract Box WorldBounds { get; }The box around the shape in the world, from its entity’s position and scale; for a shape that Turns, the box round it as it’s turned.
Methods
Section titled “Methods”Contains
Section titled “Contains”public abstract bool Contains(Vector2 point)True if point (in the world) is inside the shape, turned if it Turns.
HoldOut
Section titled “HoldOut”public void HoldOut(long step)Holds it out of the world for the step step (its scene’s Step): a slingshot’s shot waiting its turn or in the pouch. That step nothing bumps into it and it bumps into nothing; hold it again each step it’s held.