Exemplo n.º 1
0
Arquivo: UIBar.cs Projeto: wjk17/WSA
 public void Update(float t)
 {
     t           = Mathf.Clamp01(t);
     this.t      = t;
     curr.size.x = t * bg.size.x;
     GLUI.DrawQuad(Color.white, bg.ToCW().ToArray());
     GLUI.DrawQuad(color, curr.ToCW().ToArray());
 }
Exemplo n.º 2
0
 void DrawQuads(Vector2 a, Vector2 b, Vector2 c, Vector2 d, Color color, Matrix4x4 m)
 {
     a = m.MultiplyPoint(a);
     b = m.MultiplyPoint(b);
     c = m.MultiplyPoint(c);
     d = m.MultiplyPoint(d);
     GLUI.DrawQuad(a, b, c, d, color);
 }
Exemplo n.º 3
0
 public static void Draw(this Rect rt, Color color, bool solid = false)
 {
     if (solid)
     {
         GLUI.DrawQuad(rt.ToPointsCWLT(), color);
     }
     else
     {
         Draw(rt.ToPointsCWLT(), color);
     }
 }
Exemplo n.º 4
0
 public static void DrawSquare(Vector2 pos, float size, Color color, bool solid)
 {
     if (solid)
     {
         GLUI.DrawQuad(ToPointsRect(pos, size), color);
     }
     else
     {
         DrawSquare(pos, size, color);
     }
 }
Exemplo n.º 5
0
        public void Draw()
        {
            t += Time.deltaTime * speed;
            if (t > 1)
            {
                action.SafeInvoke();
                action = null;
                return;
            }
            var size = new Vector2(1, t * 0.5f);

            Rect up   = new Rect(Vector2.up.MulRef(), size.MulRef(), Vector2.up);
            Rect down = new Rect(Vector2.zero, size.MulRef(), Vector2.zero);

            GLUI.DrawQuad(Color.black, up.ToCWA());
            GLUI.DrawQuad(Color.black, down.ToCWA());
        }