//If trigger is reached then change direction void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("WalkingEnemy")) { SlugController enemyController = other.gameObject.GetComponent <SlugController>(); enemyController.changeDirection(); } }
private List <Transaction> GetTransactionsList(List <GioHangViewModel> ListItemTrongGioHang) { var transactionList = new List <Transaction>(); var get_item_list = new List <Item>(); double total = 0; foreach (var item in ListItemTrongGioHang) { double dongia = Math.Round((Convert.ToDouble(item.SanPham.DonGia) / 23000)); var paypal_item = new Item() { name = SlugController.GenerateSlug(item.SanPham.TenSanPham), currency = "USD", price = dongia.ToString(), quantity = item.SoLuong.ToString(), sku = item.SanPham.id.ToString() }; total += dongia * item.SoLuong; get_item_list.Add(paypal_item); } transactionList.Add(new Transaction() { description = "Transaction description.", invoice_number = GetRandomInvoiceNumber(), amount = new Amount() { currency = "USD", total = total.ToString(), details = new Details() { tax = "0", shipping = "0", subtotal = total.ToString() } }, item_list = new ItemList() { items = get_item_list }, payee = new Payee { // TODO.. Enter the payee email address here email = "*****@*****.**", // TODO.. Enter the merchant id here merchant_id = "MBS7H57SPXT6S" } }); return(transactionList); }