if(Input.GetMouseButtonDown(0) && isWalking == false) {
targetPosition = Camera.main.ScreenToWorldPoint (Input.mousePosition);
targetPosition.z = 0;
Debug.Log (targetPosition);
}
if (transform.position != targetPosition) {
isWalking = true;
anim.SetBool ("iswalking", true);
transform.position = Vector3.MoveTowards (transform.position, targetPosition, speed * Time.deltaTime);
} else {
anim.SetBool ("iswalking", false);
isWalking = false;
}
//Скачивается .ubff
var jo:Object = JSON.parse((e.target as URLLoader).data);
SaveManager.instance.saveBFF(jo.id,(e.target as URLLoader).data,false);
this.loadBFF(jo,!this.load_local);
// Функция загрузки JSON
private function loadBFF(book:Object, addedToLocalLib:Boolean) : void
{
var b64:Base64Decoder = null;
var name:String = null;
var pubhouse:String = null;
var author:String = null;
var year:String = null;
b64 = new Base64Decoder();
b64.decode(this.descriptBFF(book.bytearray));
SaveManager.instance.saveSWF(b64.toByteArray());
b64.decode(book.bookname);
name = b64.toByteArray().toString();
b64.decode(book.pubhouse);
pubhouse = b64.toByteArray().toString();
b64.decode(book.author);
author = b64.toByteArray().toString();
b64.decode(book.year);
year = b64.toByteArray().toString();
this.screen_paper.parseAndSetContext(book.contents);
}