protected override void Execute() { GameObject colliderGameObject = collider.gameObject; ICheckpoint checkpoint = checkpointRefs.Find(x => { bool collidedWithThisCheckpoint = colliderGameObject == x.CheckpointGameObject || colliderGameObject == x.CheckpointBoundaryGameObject; return(collidedWithThisCheckpoint); }); if (!checkpoint.Unlocked) { checkpoint.CheckpointUnlockedEffect(); checkpoint.Unlocked = true; } checkpointStatus.ReachedCheckpoint = checkpoint.CheckpointGameObject; }