Version: 2023.2
言語: 日本語
public Audio.AudioResource resource ;

説明

The default AudioResource to play.

You can also use this property to set the AudioResource that plays next.

using UnityEngine;

[RequireComponent(typeof(AudioSource))] public class ExampleClass : MonoBehaviour { public AudioResource m_Resource;

public void PlayAudioResource() { AudioSource audioSource = GetComponent<AudioSource>(); audioSource.resource = m_Resource; audioSource.Play(); } }