// Use this for initialization void Start() { Debug.Log(Mathf.Pow(1.097f, 1f / 12f) - 1); // BancoDeTextos.VerificaChavesFortes(idioma.pt_br, idioma.en_google); g = this; Cursor.lockState = CursorLockMode.Locked; //Para ajudar a programar o tuto MyKeys.MudaShift(KeyShift.estouNoTuto, comCriature); /*************************************************/ usoDeItens = new MbUsoDeItem(); VerificaSetarManager(); encontros.Start(); HudM.StatusHud.Start(); imgMenu = FindObjectOfType <ImageMenu>();//Instantiate((GameObject)Resources.Load("HUD_Itens")).GetComponent<ImageMenu>(); }
protected override void OnRightTapped(RightTappedRoutedEventArgs e) { e.Handled = true; //Hide(); ImageMenu.ShowAt(this, e.GetPosition(this)); }
// Update is called once per frame IEnumerator SetupScreen(string _config) { yield return(new WaitForSeconds(1)); var json = JSON.Parse(_config); //if active susbcription if (json[0].Value == "False") { yield return(null); } else { arrowSize.x = float.Parse(json[3].Value.ToString().Substring(0, json[3].Value.ToString().IndexOf("x"))); arrowSize.y = float.Parse(json[3].Value.ToString().Substring(json[3].Value.ToString().IndexOf("x") + 1)); hArrow.transform.localScale = new Vector3(arrowSize.x, arrowSize.y, 1); string[] colorSpecs = json[4].Value.ToString().Split(','); hArrow.GetComponent <Image>().color = new Color(float.Parse(colorSpecs[0]), float.Parse(colorSpecs[1]), float.Parse(colorSpecs[2])); AnimationSpeed = float.Parse(json[5].Value.ToString()); AnimationTime = float.Parse(json[6].Value.ToString()); AnimationDelay = float.Parse(json[7].Value.ToString()); AnimationDelayEnd = float.Parse(json[8].Value.ToString()); EaseType = json[9].Value.ToString(); yPosition = float.Parse(json[10].Value.ToString()); xCoutns = json[11].Count; for (int i = 0; i < xCoutns; i++) { xPositions.Add(float.Parse(json[11][i][0].Value.ToString())); } hArrow.transform.localPosition = new Vector3(xPositions[0], yPosition, 0); //Downloading menu images ImageMenu _img_l; // = new ImageMenu(); ImageMenu _img_s; //= new ImageMenu(); for (int i = 0; i < json[12].Count; i++) { //large image _img_l = new ImageMenu(); var www = new WWW(json[12][i][3].Value.ToString() + json[12][i][0].Value.ToString() + ".png"); yield return(www); LmenuImage.texture = www.texture; _img_l.image = LmenuImage; _img_l.txture = www.texture; www = null; _img_l.position.x = float.Parse(json[12][i][1].Value.ToString().Substring(0, json[12][i][1].Value.ToString().IndexOf("x"))); _img_l.position.y = float.Parse(json[12][i][1].Value.ToString().Substring(json[12][i][1].Value.ToString().IndexOf("x") + 1)); _img_l.size.x = float.Parse(json[12][i][2].Value.ToString().Substring(0, json[12][i][2].Value.ToString().IndexOf("x"))); _img_l.size.y = float.Parse(json[12][i][2].Value.ToString().Substring(json[12][i][2].Value.ToString().IndexOf("x") + 1)); LargeImages.Add(_img_l); } //Small image GameObject go; for (int i = 0; i < json[12].Count; i++) { go = new GameObject(); go.AddComponent <RawImage>(); go.name = "mini" + i.ToString(); go.transform.parent = hArrow.transform.parent; var www2 = new WWW(json[12][i][7].Value.ToString() + json[12][i][4].Value.ToString() + ".png"); yield return(www2); go.GetComponent <RawImage>().texture = www2.texture; go.GetComponent <RectTransform>().sizeDelta = new Vector2(); go.GetComponent <RectTransform>().localPosition = new Vector3(); RectTransform rt = go.gameObject.GetComponent <RectTransform>(); rt.sizeDelta = new Vector2(float.Parse(json[12][i][6].Value.ToString().Substring(0, json[12][i][6].Value.ToString().IndexOf("x"))), float.Parse(json[12][i][6].Value.ToString().Substring(json[12][i][6].Value.ToString().IndexOf("x") + 1))); rt.localPosition = new Vector3(float.Parse(json[12][i][5].Value.ToString().Substring(0, json[12][i][5].Value.ToString().IndexOf("x"))), float.Parse(json[12][i][5].Value.ToString().Substring(json[12][i][5].Value.ToString().IndexOf("x") + 1)), 0); SmallImages.Add(go.GetComponent <RawImage>()); } // If time base if (json[1].Value.ToString() == "True") { hrs = int.Parse(json[2].Value.ToString().Substring(0, 2)); mins = int.Parse(json[2].Value.ToString().Substring(3)); int calcTime; calcTime = mins - DateTime.Now.Minute; StartCoroutine(startWorking(calcTime * 60)); } else { StartCoroutine(startWorking(5.0f)); } } }