public UShape(UGraphics g)
 {
     this.g      = g;
     style       = new UGraphics.UStyle(g);
     vertexType  = VertexType.NONE;
     shapeKind   = ShapeKind.NONE;
     isClockwise = !g.isP5;
 }
Ejemplo n.º 2
0
 public void load(UGraphics g, string path)
 {
     this.path = path;
     if (path.StartsWith("http://") || path.StartsWith("https://") || path.StartsWith("file://"))
     {
         StartCoroutine("loadFromURL", path);
         Debug.Log("loadImage:loadFromURL " + path);
     }
     else
     {
         if (!loadFromResources(g, path))
         {
             loadFromLocalFile(path);
         }
     }
 }
Ejemplo n.º 3
0
        bool loadFromResources(UGraphics g, string path)
        {
            string    resPath = g.getResourceName(path);
            Texture2D tex     = Resources.Load(resPath) as Texture2D;

            set(tex);
            if (tex != null)
            {
                Debug.Log("loadImage:loadFromResources " + resPath);
                if (width == 0)
                {
                    width = texWidth;
                }
                if (height == 0)
                {
                    height = texHeight;
                }
            }
            else
            {
                Debug.LogWarning("loadImage:loadFromResources <Failed> " + resPath);
            }
            return(tex != null);
        }
 public void curveVertex(Vector3 pos)
 {
     UGraphics.assert(vertexType == VertexType.CURVE_LINES || vertexType == VertexType.CURVE_LINE_STRIP);
     vertices.Add(pos);
     colors.Add(nowColor);
 }