feat: ICollider IsTrigger

This commit is contained in:
Syntriax 2024-01-27 20:19:00 +03:00
parent 0d4c96a2fc
commit 574104c224
2 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,7 @@ public interface ICollider2D : IBehaviour, IAssignableTransform
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionResolved { get; set; }
IRigidBody2D? RigidBody2D { get; }
bool IsTrigger { get; set; }
void Recalculate();
}

View File

@ -16,9 +16,11 @@ public abstract class Collider2DBehaviourBase : BehaviourOverride, ICollider2D
protected IRigidBody2D? _rigidBody2D = null;
public IRigidBody2D? RigidBody2D => _rigidBody2D;
public bool IsTrigger { get; set; } = false;
ITransform IAssignableTransform.Transform => Transform;
Action<IAssignableTransform>? IAssignableTransform.OnTransformAssigned { get => GameObject.OnTransformAssigned; set => GameObject.OnTransformAssigned = value; }
bool IAssignableTransform.Assign(ITransform transform) => GameObject.Assign(transform);
public void Recalculate()