文档

Unity Engine

Unity Engine

GetExistingTag(string)

Get a handle to a existing defined tag.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static TagHandle GetExistingTag(string tagName)

Parameters

tagName

The name of the tag to get a handle to.

Returns

Type

Description

TagHandleA new TagHandle for the existing tag.

Remarks

This method can only be used to get references to tags that were already defined. If you pass a tag name which is not already defined, it will throw an exception.
Additional Resources: GameObject.CompareTag.