Skip to main content

DoCompareTag

Description

Compare whether two tags are consistent. It is similar to Unity's CompareTag method.

Parameters

ParamTypeDescription
_tagStringUnique name

Method

public void DoCompareTag(string _tag)

Example

::: Caution You must add the GameObjectRuntimeTag script to the gameObject you will use for retrieval and enter Tag into the GameObjectRuntimeTag.RuntimeTag field. :::

private void OnLoad(){
RuntimeTagManager.GetRuntimeTagManager.GetGameObjectByTag("Player",out GameObject tmp_Player);
if(tmp_Player.GetComponent<IRuntimeTag>().DoCompareTag("Player")){
Debug.Log(tmp_Player.name);
}
}