public void HandlePaidInvoice(object sender, InvoiceSettledEventArgs e) { if (activeInvoices.ContainsKey(e.Invoice.PaymentRequest)) { EventDict[activeInvoices[e.Invoice.PaymentRequest].type].OnInvoicePaid(e.Invoice, activeInvoices[e.Invoice.PaymentRequest].sender, activeInvoices[e.Invoice.PaymentRequest].data); } }
void ReadInvoice(object sender, InvoiceSettledEventArgs e) { Debug.Log(e.Invoice.RPreimage.ToBase64()); var info = e.Invoice.Memo.Split(';'); //Debug.Log(info[0]); lastPowerUpText.text = info[0]; lastPowerUpText.color = (info[1] == "1") ? Color.blue : Color.red; roundBounty += (int)e.Invoice.Value; switch (info[0]) { case ("reload"): //GetComponent<Complete.GameManager>().m_Tanks[int.Parse(info[1])- 1].m_Instance.GetComponent<Complete.TankShooting>().addAmmo((int)e.Invoice.Value / 5); break; case ("speed"): GetComponent <Complete.GameManager>().m_Tanks[int.Parse(info[1]) - 1].m_Instance.GetComponent <TankPowerup>().ActivateSpeedBoost(e.Invoice.Value / 5); break; case ("shield"): GetComponent <Complete.GameManager>().m_Tanks[int.Parse(info[1]) - 1].m_Instance.GetComponent <TankPowerup>().ActivateShield(e.Invoice.Value / 5); break; case ("mine"): GetComponent <MineSpawner>().spawnMine(int.Parse(info[1]) - 1); break; } UpdateBounty(); }
void ChangeWeather(object sender, InvoiceSettledEventArgs e) { Debug.Log(e.Invoice.Memo); var response = ""; switch (e.Invoice.Memo) { case ("rain"): response = "RAIN ACTIVATED"; break; case ("fire"): response = "FIRE ACTIVATED"; break; case ("wind"): response = "Wind ACTIVATED AT SPEED " + e.Invoice.Value; break; } if (response != "") { IRC.SendMsg(response); GetComponent <TwitchChatExample>().CreateUIMessage("sputnck1", response); } }
void ChangeWeather(object sender, InvoiceSettledEventArgs e) { Debug.Log(e.Invoice.Memo); switch (e.Invoice.Memo) { case ("rain"): ActivateEffect(0); break; case ("fire"): ActivateEffect(1); break; case ("wind"): SetWindZone((int)e.Invoice.Value); break; } }