43 lines
1.0 KiB
ActionScript
43 lines
1.0 KiB
ActionScript
package net.pixvi.myr.net
|
|
{
|
|
import net.pixvi.pfw.utils.core.Singleton;
|
|
|
|
public class NetSkin
|
|
{
|
|
|
|
public static const SET_SKIN:String = "monsterService/monsterSetSkin";
|
|
|
|
private var onSetSkinComplete:Function;
|
|
|
|
public function NetSkin()
|
|
{
|
|
super();
|
|
}
|
|
|
|
public static function getIns() : NetSkin
|
|
{
|
|
return Singleton.getInstanceOrCreate(NetSkin) as NetSkin;
|
|
}
|
|
|
|
public function setSkin(monsterId:uint, skinTypeId:String, onComplete:Function) : void
|
|
{
|
|
onSetSkinComplete = onComplete;
|
|
var para:Object = {
|
|
"monsterId":monsterId,
|
|
"skinType":skinTypeId
|
|
};
|
|
NetCenter.getIns().send("monsterService/monsterSetSkin",para,setSkinHandler);
|
|
}
|
|
|
|
private function setSkinHandler(re:Object) : void
|
|
{
|
|
if(onSetSkinComplete != null)
|
|
{
|
|
onSetSkinComplete(re);
|
|
onSetSkinComplete = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|