private void OnGUI()
    {
        int w = 320;
        int h = 240;

        if (me == null)
        {
            me = GetComponent <RectTransform>();
        }

        Rect R = TamanhoDoUI.RectSize(me);

        if (GUI.Button(R, "", ((GUISkin)Resources.Load("meuSkin")).button))
        {
            BotaoRecompensas();
        }

        GUIStyle tempStyle = new GUIStyle(((GUISkin)Resources.Load("meuSkin")).label);

        tempStyle.fontSize  = 7;
        tempStyle.alignment = TextAnchor.UpperCenter;
        tempStyle.font      = (Font)Resources.Load("MYRIADPRO-BOLDIT");


        GUI.Label(new Rect(R.x + 0.01f * w, R.y + 0.01f * h, R.width - 0.02f * w, R.height - 0.02f * h), "Premios", tempStyle);



        if (numRecompensas.enabled)
        {
            tempStyle.alignment = TextAnchor.LowerCenter;
            tempStyle.fontSize  = 10;
            GUI.Label(new Rect(R.x + 0.01f * w, R.y + 0.01f * h, R.width - 0.02f * w, R.height - 0.02f * h), numRecompensas.text, tempStyle);
        }
    }
Example #2
0
    private void OnGUI()
    {
        Rect R = default(Rect);
        int  w = 320;
        int  h = 240;

        R = TamanhoDoUI.RectSize(me);

        if (GUI.Button(R, "", ((GUISkin)Resources.Load("meuSkin")).button))
        {
            BotaoNivelJogador();
        }

        GUIStyle tempStyle = new GUIStyle(((GUISkin)Resources.Load("meuSkin")).label);

        tempStyle.fontSize  = 7;
        tempStyle.alignment = TextAnchor.UpperCenter;
        tempStyle.font      = (Font)Resources.Load("MYRIADPRO-BOLDIT");


        GUI.Label(new Rect(R.x + 0.01f * w, R.y + 0.01f * h, R.width - 0.02f * w, R.height - 0.02f * h), "Nivel de Jogador", tempStyle);
        tempStyle.alignment = TextAnchor.LowerCenter;
        tempStyle.fontSize  = 10;
        GUI.Label(new Rect(R.x + 0.01f * w, R.y + 0.01f * h, R.width - 0.02f * w, R.height - 0.02f * h), nivelDoJogador.text, tempStyle);
    }
Example #3
0
    private void OnGUI()
    {
        if (B.interactable && B.gameObject.activeSelf && B.enabled)
        {
            Rect R = TamanhoDoUI.RectSize(B.image.rectTransform);

            string txt = txtBtn != null ? txtBtn.text : "";
            if (GUI.Button(R, txt, skin.button))
            {
                B.onClick.Invoke();
            }
        }
    }
Example #4
0
 private void OnGUI()
 {
     if (img != null)
     {
         if (img.enabled && img.gameObject.activeSelf)
         {
             Rect      R             = TamanhoDoUI.RectSize(img.rectTransform);
             GUIStyle  tempStyle     = new GUIStyle(((GUISkin)Resources.Load("meuSkin")).box);
             Texture2D texturaSacana = img.sprite.texture;
             tempStyle.normal.background = texturaSacana;
             tempStyle.hover.background  = texturaSacana;
             tempStyle.active.background = texturaSacana;
             GUI.Box(R, "", tempStyle);
         }
     }
 }