Exemplo n.º 1
0
    private void DrawQuad(Color aColor, float aAlpha)
    {
        if (!m_Instance.gameObject.GetComponent <GUITexture> ())
        {
            m_Instance.gameObject.AddComponent <GUITexture> ();
        }
        m_Instance.gameObject.transform.localScale = Vector3.zero;
        Texture2D tex2d = new Texture2D(1, 1);

        tex2d.SetPixels(new Color[1] {
            Color.white
        });
        tex2d.Apply();
        m_Instance.gameObject.GetComponent <GUITexture>().texture = tex2d;

        m_Instance.GetComponent <GUITexture>().pixelInset = new Rect(0, 0, Screen.width, Screen.height);
        m_Instance.GetComponent <GUITexture> ().color     = new Color(aColor.r, aColor.g, aColor.b, aAlpha);
    }