GameObject.tag 标签

var tag : string

Description描述

The tag of this game object.
A tag can be used to identify a game object. Tags must be declared in the tag manager before using them.

游戏物体的标签。
一个标签可以用于识别一个游戏物体标签必须在使用之前在标签管理器里面先声明。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		gameObject.tag = "Player";

	}

}
gameObject.tag = "Player";
Page last updated: 2011-5-19