【发布时间】:2011-06-21 03:58:24
【问题描述】:
我想在玩家执行特定操作时播放一个声音提示。我玩得很好,一切都很好,但我想让使用的资源来自配置文件,而不是硬编码。
所以我在我的类中添加了一个名为 MonsterNoiseSoundCue 的属性,如下所示:
var config SoundCue MonsterNoiseSoundCue;
然后在 DefaultProperties 部分中,我将以下内容添加到我创建的对象中,然后将其添加到我的 pawn 的组件集合中。
Begin Object Class=AudioComponent Name=MonsterActivatedSound1
bAutoPlay=false
SoundCue=MonsterNoiseSoundCue// This variable is a configured value. SoundCue'CastleAudio.UI.UI_StopTouchToMove_Cue'
End Object
Components.Add(MonsterActivatedSound1);
MonsterActivatedSound = MonsterActivatedSound1;
由于某种原因,它不会说“不允许将'config'与对象变量一起使用。”有谁知道解决这个问题的另一种方法?
【问题讨论】:
标签: unreal-development-kit unrealscript