Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AudioStreamPlaybackInteractive

继承: AudioStreamPlayback < RefCounted < Object

AudioStreamInteractive 的播放组件。

描述

AudioStreamInteractive 的播放组件。包含更改当前播放剪辑的函数。

方法

int

get_current_clip_index() const

void

switch_to_clip(clip_index: int)

void

switch_to_clip_by_name(clip_name: StringName)


方法说明

int get_current_clip_index() const 🔗

返回当前正在播放的剪辑的索引。可以通过 AudioStreamInteractive.get_clip_name() 用该索引获取当前正在播放的剪辑的名称。

示例:AudioStreamPlayer 节点中获取当前正在播放的剪辑的名称。

var playing_clip_name = stream.get_clip_name(get_stream_playback().get_current_clip_index())

void switch_to_clip(clip_index: int) 🔗

切换到剪辑(根据索引)。


void switch_to_clip_by_name(clip_name: StringName) 🔗

切换到剪辑(根据名称)。