public GameObject gameObject ;

描述

此组件附加到的游戏对象。始终将组件附加到游戏对象。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Example() { print(gameObject.name); } }