GetGameObjectByTag
Description
Finding the gameObject by tag
Parameters
| Param | Type | Description |
|---|---|---|
| _tag | String | Unique name |
| _gameObject | GameObject(out) | The search result |
Method
caution
You must add the GameObjectRuntimeTag script to the gameObject you will use for retrieval and enter Tag into the GameObjectRuntimeTag.RuntimeTag field.
public void GetGameObjectByTag(string _tag,GameObject _gameObject)
Example
private void OnLoad(){
RuntimeTagManager.GetRuntimeTagManager.GetGameObjectByTag("Player",out GameObject tmp_Player);
if(tmp_Player.GetComponent<IRuntimeTag>().DoCompareTag("Player")){
Debug.Log(tmp_Player.name);
}
}