i want make simple audio with array so a can call it anytime
var snd : AudioClip[];
static var snp : AudioClip[];
function Awake(){
snd=snp;
}
static function teriak(i :int){
this.audio.PlayOneShot(snp*);*
}
but it give error
Assets/Scripts/SoundArr.js(11,14): BCE0020: An instance of type ‘UnityEngine.Component’ is required to access non static member ‘audio’.
any help?
UPDATE
coz i just use it once, i made this an it work
var snd : AudioClip;
static var soo :boolean=false;
function Update(){
-
if(soo) {*
-
soo=false;*
-
teriak();*
-
}*
- }*
function teriak(){
- audio.PlayOneShot(snd);*
}