TagSet HitboxTags { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The HitboxTags property of the ManualHitbox class represents a set of tags associated with the hitbox. These tags can be used to categorize or identify the hitbox for various purposes, such as filtering or grouping during collision detection or game logic processing.

Usage

To use the HitboxTags property, you can get or set the tags for a ManualHitbox instance. This property is useful for managing and organizing hitboxes within your game, allowing you to apply specific logic based on the tags assigned to each hitbox.

Example

// Example of setting and getting HitboxTags for a ManualHitbox

// Create a new ManualHitbox instance
ManualHitbox hitbox = new ManualHitbox();

// Set tags for the hitbox
hitbox.HitboxTags = new TagSet { "Player", "Damageable" };

// Retrieve and print the tags
TagSet tags = hitbox.HitboxTags;
foreach (var tag in tags)
{
    // Process each tag
    // For example, you might want to log or use the tags in game logic
    Console.WriteLine(tag);
}