Version: 5.4
Removed
Property audio has been deprecated. Use GetComponent<AudioSource>() instead. (UnityUpgradable)

GameObject.audio

マニュアルに切り替える
public Component audio ;

説明

GameObject にアタッチされている AudioSource (読み取り専用)。(アタッチされていない場合は null)。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public GameObject other; void Example() { other.GetComponent<AudioSource>().Play(); } }