-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Define tags
[assembly: GameplayTag("Tile.Obstacle")]
[assembly: GameplayTag("Tile.Walkway")]
[assembly: GameplayTag("Tile.Walkway.Start")]
[assembly: GameplayTag("Tile.Walkway.End")]
[assembly: GameplayTag("Tile.Link.Source")]
[assembly: GameplayTag("Tile.Link.Target")]
[assembly: GameplayTag("Tile.PatrolPath")]
[assembly: GameplayTag("Tile.PatrolPath.Start")]
[assembly: GameplayTag("Tile.Negative.Item_A")]
[assembly: GameplayTag("Tile.Positive.Item_B")]
Test code
public class TestHasAny : MonoBehaviour
{
private void Start()
{
var container1 = new GameplayTagContainer();
container1.AddTag(AllGameplayTags.Tile.Walkway.Get());
container1.AddTag(AllGameplayTags.Tile.Negative.Item_A.Get());
var blockingContainer = new GameplayTagContainer();
blockingContainer.AddTag(AllGameplayTags.Tile.Walkway.Start.Get());
blockingContainer.AddTag(AllGameplayTags.Tile.Walkway.End.Get());
blockingContainer.AddTag(AllGameplayTags.Tile.Obstacle.Get());
blockingContainer.AddTag(AllGameplayTags.Tile.Link.Get());
blockingContainer.AddTag(AllGameplayTags.Tile.PatrolPath.Get());
blockingContainer.AddTag(AllGameplayTags.Tile.Negative.Get());
blockingContainer.AddTag(AllGameplayTags.Tile.Positive.Get());
bool result = container1.HasAny(blockingContainer);
Debug.Log($"container1 has blocking tags: {result}");
}
}
The result is false, it can't find the container has Tile.Negative.
Metadata
Metadata
Assignees
Labels
No labels