Ejemplo n.º 1
0
    //This section will remain expanded until I
    //Move the Circles here by changing their transform.
    void MakeBoundaries(Vector3[] endPoints, Vector3[,] sectionReflections)
    {
        //innermost circle
        Boundaries.PlaceCircle(sectionReflections[0, 7], sectionReflections[2, 7], lineParams.BoundaryWidth, lineParams.BoundaryWidth);

        //innermost square
        for (int ii = 0; ii < 4; ii++)
        {
            squarePoints[ii] = sectionReflections[ii, 7];
        }
        Boundaries.PlaceSquare(squarePoints, lineParams.BoundaryWidth, lineParams.BoundaryWidth);

        //Three concentric squares:
        //one will be a gate, eventually.
        int col = 4;

        for (int z = 1; z < 4; z++)
        {
            for (int ii = 0; ii < 4; ii++)
            {
                squarePoints[ii]    = sectionReflections[ii, sectionReflections.GetLength(1) - col];
                squarePoints[ii].z -= z;
            }
            Boundaries.PlaceSquare(squarePoints, lineParams.BoundaryWidth, lineParams.BoundaryWidth);
            col--;
        }
        //outermost square. Use endpoints rather than sectionReflections.
        //note that endPoints lie within sectionReflections.
        for (int ii = 0; ii < 4; ii++)
        {
            squarePoints[ii]    = endPoints[ii];
            squarePoints[ii].z -= 4;
        }
        Boundaries.PlaceSquare(squarePoints, lineParams.BoundaryWidth, lineParams.BoundaryWidth);

        //four outermost concentric circles:
        //4 is the offset at which the squares left off.
        //int z = -4;
        for (int XYoffset = 0; XYoffset < 4; XYoffset++)
        {
            Boundaries.PlaceCircle(endPoints[0] - new Vector3(XYoffset, XYoffset, 0), endPoints[2] + new Vector3(XYoffset, XYoffset, 0), lineParams.BoundaryWidth, lineParams.BoundaryWidth);
            //z--;
        }

        //At this point, the boundaries have been placed.
        //give Materials and set color for Circles and squares:
        GameObject[] circles = GameObject.FindGameObjectsWithTag("circle");
        GameObject[] squares = GameObject.FindGameObjectsWithTag("square");
        AssignBoundaryMats(circles, squares);

        //set width, offset, and tiling
        ConfigureBoundaryCostumes(circles, squares);

        //Order when each boundary appears
        Material[] boundaryMats = OrderBoundaries(circles, squares);

        //Reveal the Boundaries
        StartCoroutine(MGMT.CentralLoop(boundaryMats, MGMT._CenterPieceMat, MGMT.SectionSeconds, lineParams.Sections, squares, circles));
        //Reveal the Background triangles
        SetBackgroundTriangles(MGMT.BackgroundTriangles, endPoints);
    }