void Update() { GameObject zzz = GameObject.Find("glasses"); shop_anim keimena = zzz.GetComponent <shop_anim> (); Grand_Total = keimena.gTotal; GameObject zzz2 = GameObject.Find("glasses"); shop_anim keimena2 = zzz2.GetComponent <shop_anim> (); energy = keimena2.das_energy; Energy_Points.text = "" + energy; PlayerPrefs.SetInt("Grand_Total", Grand_Total); tPoints.text = "Total Points = " + Grand_Total; current_Time = System.DateTime.Now.ToString(); if (energy == 0) { fly.enabled = false; Reminder.enabled = true; DateTime da_quit = Convert.ToDateTime(PlayerPrefs.GetString("quit_Time")); DateTime date_current_Time = Convert.ToDateTime(current_Time); TimeSpan difference = date_current_Time - da_quit; if (difference.TotalSeconds > 300) { reload(); } timer -= Time.deltaTime; int minutes = Mathf.FloorToInt(timer / 60F); // Debug.LogError(difference); your_energy.text = "You will have +5 energy in: " + minutes + " minutes"; } else { Reminder.enabled = false; fly.enabled = true; } // Debug.LogError (final_dif); }
void Update() { Application.targetFrameRate = 60; GameObject zzz2 = GameObject.Find("glasses"); shop_anim keimena2 = zzz2.GetComponent <shop_anim> (); energy = keimena2.das_energy; Energy_Points.text = "" + energy; Vector2 offset = GetComponent <Renderer>().material.mainTextureOffset; offset.x += speed * (Time.deltaTime / 10); offset.x = (offset.x) % 1; GetComponent <Renderer>().material.mainTextureOffset = offset; }
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { // A consumable product has been purchased by this user. if (String.Equals(args.purchasedProduct.definition.id, Product_Thug_Life, StringComparison.Ordinal)) { GameObject shopp = GameObject.Find("glasses"); shop_anim st = shopp.GetComponent <shop_anim> (); st.Successfull_transaction(); Debug.LogError("You just bought thug life glasses"); } // Or ... a non-consumable product has been purchased by this user. else if (String.Equals(args.purchasedProduct.definition.id, Product_Xmas_Hat, StringComparison.Ordinal)) { GameObject shopp2 = GameObject.Find("glasses"); shop_anim st2 = shopp2.GetComponent <shop_anim> (); st2.Successfull_transaction(); Debug.LogError("You just bought xmas life"); } else if (String.Equals(args.purchasedProduct.definition.id, Product_energy, StringComparison.Ordinal)) { GameObject shopp2 = GameObject.Find("glasses"); shop_anim st2 = shopp2.GetComponent <shop_anim> (); st2.Successfull_transaction(); Debug.LogError("You just bought +200 Energy"); } else { Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); } // Return a flag indicating whether this product has completely been received, or if the application needs // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still // saving purchased products to the cloud, and when that save is delayed. return(PurchaseProcessingResult.Complete); }