let img_pl_sloweffect = GetCurrentScriptDirectory~"./../img/sloweffect.png";
let img_pl_deadcircle = GetCurrentScriptDirectory~"./../img/deadcircle.png";
let img_pl_particle = GetCurrentScriptDirectory~"./../img/particle.png";
let img_pl_circle = GetCurrentScriptDirectory~"./../img/circle.png";
let img_pl_bomb = GetCurrentScriptDirectory~"./../img/bomb.png";

let se_dead;
let se_graze;
let se_nep00;
let se_shot;
let se_slash;
let se_tan00;

let common_files = [img_pl_sloweffect,img_pl_deadcircle,img_pl_particle,img_pl_circle,img_pl_bomb];

task Load_Common_Files{
	ascent(f in 0..length(common_files)){
		LoadTexture(common_files);
	}
	se_dead = SE_Load(GetCurrentScriptDirectory~"./../se/dead.wav");
	se_graze = SE_Load(GetCurrentScriptDirectory~"./../se/graze.wav");
	se_nep00 = SE_Load(GetCurrentScriptDirectory~"./../se/nep00.wav");
	se_shot = SE_Load(GetCurrentScriptDirectory~"./../se/shot.wav");
	se_slash = SE_Load(GetCurrentScriptDirectory~"./../se/slash.wav");
	se_tan00 = SE_Load(GetCurrentScriptDirectory~"./../se/tan00.wav");
}

task Unload_Common_Files{
	ascent(f in 0..length(common_files)){
		RemoveTexture(common_files);
	}
	SE_Remove(se_dead);
	SE_Remove(se_graze);
	SE_Remove(se_nep00);
	SE_Remove(se_shot);
	SE_Remove(se_slash);
	SE_Remove(se_tan00);
}

function SE_Play(se,vol,pan){
	ObjSound_SetVolumeRate(se,vol*(GetCommonData("Volume",100)/100));
	ObjSound_SetPanRate(se,pan);
	ObjSound_Play(se);
}

function SE_Stop(se){
	ObjSound_Stop(se);
}

function SE_Load(se){
	let obj = ObjSound_Create();
	ObjSound_Load(obj,se);
	ObjSound_SetSoundDivision(obj,SOUND_SE);
	return obj;
}

function SE_Remove(obj){
	Obj_Delete(obj);
}