Version: 2023.2
言語: 日本語

AudioResource

class in UnityEngine.Audio

/

継承:Object

マニュアルに切り替える

説明

Represents an audio resource asset that you can play through an AudioSource.

Additional resources: AudioClip, AudioRandomContainer

using System.Collections;
using UnityEngine;
using UnityEngine.Audio;

// Play an AudioClip, then an AudioResource, through an AudioSource. [RequireComponent(typeof(AudioSource))] public class ExampleClass : MonoBehaviour { public AudioClip m_Clip; public AudioResource m_Resource;

IEnumerator Start() { AudioSource audioSource = GetComponent<AudioSource>(); audioSource.resource = m_Clip; audioSource.Play();

yield return new WaitForSeconds(audioSource.clip.length);

audioSource.resource = m_Resource; audioSource.Play(); } }

継承メンバー

変数

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名

Public 関数

GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。