예제 #1
0
 public void SetNeighborCube(NeighborType type, BackgroundCube cube)
 {
     neighborCubes[(int)type] = cube;
 }
예제 #2
0
    BackgroundCube FindBackgroundCubeBySector(Sector sector)
    {
        BackgroundCube cube = backgroundCubes[0][0];

        // the most center BackgroundCube
        float y = 0.5f;
        float x = 0.5f;

        switch (sector)
        {
        case Sector.Left:
            x -= xOffset_3set;
            break;

        case Sector.Center:
            break;

        case Sector.Right:
            x += xOffset_3set;
            break;

        case Sector.Left_Left:
            x -= xOffset_6set * 2;
            y += yOffset_6set;
            break;

        case Sector.Right_Right:
            x += xOffset_6set * 2;
            y += yOffset_6set;
            break;

        case Sector.Center_Left:
            x -= xOffset_6set;
            y += yOffset_6set;
            break;

        case Sector.Center_Right:
            x += xOffset_6set;
            y += yOffset_6set;
            break;

        case Sector.Top_Left:
            x -= xOffset_6set * 1.5f;
            y -= yOffset_6set;
            break;

        case Sector.Top_Right:
            x += xOffset_6set * 1.5f;
            y -= yOffset_6set;
            break;
        }

        int i = (int)(backgroundCubes.Count * y);
        int j = (int)(backgroundCubes[0].Count * x);

        if (CheckValidIndexOfBackgroundCubes(i, j))
        {
            cube = backgroundCubes[i][j];
        }

        return(cube);
    }