Esempio n. 1
0
        private void SetResult(ConnectGamer gamer)
        {
            LanguageDictionary language = new LanguageDictionary();
            GameMechanic       game     = gamer.Game.Game;

            List <JsonResult> results = game.Results().Select(x => new JsonResult()
            {
                Feature = x.Feature.Value(language.GetLanguage()),
                Id      = x.Gamer.Id
            }).ToList();

            Clients.Clients(GamersId(gamer)).SetResult(results, language.Get("Result"));
        }
Esempio n. 2
0
    /* Scale the size of listBox accroding to the Y position.
     */
    public void updateSize()
    {
        ListPositionCtrl.Instance.scaleFactor = (ListBank.Instance.canvasRect.rect.width / 20640);

        float imageScale = ListPositionCtrl.Instance.scaleFactor * (float)0.80;

        this.GetComponentInChildren <Image> ().rectTransform.localScale = new Vector3(imageScale, imageScale, 1);

        transform.localScale = originalLocalScale *
                               (1.0f + ListPositionCtrl.Instance.scaleFactor * (upperBoundWorldPosY - Mathf.Abs(transform.position.y)));
        Color c = contentImage.color;

        if (transform.localScale.x >= (ListPositionCtrl.Instance.maior - (ListPositionCtrl.Instance.maior * 0.05)))
        {
            ListPositionCtrl.Instance.maior = transform.localScale.x;

//			var audio = gameObject.GetComponentInChildren<AudioSource>();
//
//			if(audio){
//
//				audio.Play();
//
//			}else{
//
//				print("Nenhuma musica instanciada no objeto");
//			}
            var lang = LanguageDictionary.GetLanguage();


            //PASSANDO OS DETALHES DOS ITENS PARA OS TEXTS
            contentTitle.text = content.Title;

            if (lang == SystemLanguage.English || lang == SystemLanguage.Unknown)
            {
                contentPrice.text = "Price: " + content.Value.ToString();
            }
            if (lang == SystemLanguage.Portuguese)
            {
                contentPrice.text = "Preço: " + content.Value.ToString();
            }



            if (content.ID == 5)
            {
                if (lang == SystemLanguage.English || lang == SystemLanguage.Unknown)
                {
                    contentDetails.text = "Bullets: " + ListBank.Instance.behave.bullets[1] + ".\n" + "  " + content.Description;
                }
                if (lang == SystemLanguage.Portuguese)
                {
                    contentDetails.text = "Balas: " + ListBank.Instance.behave.bullets[1] + ".\n" + "  " + content.Description2;
                }
            }

            else if (content.ID == 6)
            {
                if (lang == SystemLanguage.English || lang == SystemLanguage.Unknown)
                {
                    contentDetails.text = "Bullets: " + ListBank.Instance.behave.bullets[2] + ".\n" + "  " + content.Description;
                }
                if (lang == SystemLanguage.Portuguese)
                {
                    contentDetails.text = "Balas: " + ListBank.Instance.behave.bullets[2] + ".\n" + "  " + content.Description2;
                }
            }
            else
            {
                if (lang == SystemLanguage.English || lang == SystemLanguage.Unknown)
                {
                    contentDetails.text = content.Description;
                }
                if (lang == SystemLanguage.Portuguese)
                {
                    contentDetails.text = content.Description2;
                }
            }


            //PASSANDO PRA LOJA O VALOR E O ID DE CADA ITEM
            ListBank.Instance.itemToBuy = content;

            c.a = 255;
            contentImage.color = c;
        }
        else
        {
            c.a = 0.3f;
            contentImage.color = c;
        }
    }