Exemplo n.º 1
0
    void displayGrid()
    {
        Object linePrefab = Resources.Load("gridLine");

        Assert.IsNotNull(linePrefab);

        // Horizontal lines
        for (float h = minH - 0.5f; h <= maxH + 0.5f; h += 1.0f)
        {
            GameObject line = (GameObject)GameObject.Instantiate(linePrefab, Vector3.zero, Quaternion.identity);
            Drawing.AddOneNodeToLine(line, new Vector2(minW, h));
            Drawing.AddOneNodeToLine(line, new Vector2(maxW, h));
        }
        // Vertical lines
        for (float w = minW - 0.5f; w <= maxW + 0.5f; w += 1.0f)
        {
            GameObject line = (GameObject)GameObject.Instantiate(linePrefab, Vector3.zero, Quaternion.identity);
            Drawing.AddOneNodeToLine(line, new Vector2(w, minH));
            Drawing.AddOneNodeToLine(line, new Vector2(w, maxH));
        }
    }