unity check tag

C#
gameObject.tag
Source

Also in C#: