Obsolete public Component audio ;

설명

The AudioSource attached to this GameObject (Read Only). (Null if there is none attached).

using UnityEngine;

public class Example : MonoBehaviour { void Start() { gameObject.GetComponent<AudioSource>().Play(); } }