예제 #1
0
    void SetColoredBeatValues(BoxColor color)
    {
        //Left 90 degrees
        switch (color)
        {
        case BoxColor.Red:
            xOffset = -xOffsetRef;
            //if (hitDir == Direction.Left) hitDir = Direction.Right; //Not Needed as Default for Horizontal is Direction.Right

            MaterialUtils.ChangeMaterialColor(beatMat, gm.diffuseColors[0]);
            MaterialUtils.ChangeMaterialEmission(beatMat, gm.emissiveColors[0], gm.emissiveIntensities[0]);

            MaterialUtils.ChangeMaterialColor(markerMat, gm.diffuseColors[0]);
            MaterialUtils.ChangeMaterialEmission(markerMat, gm.emissiveColors[0], gm.emissiveIntensities[0]);
            break;

        case BoxColor.Yellow:
            xOffset = -xOffsetRef;
            //if (hitDir == Direction.Left) hitDir = Direction.Right; //Not Needed as Default for Horizontal is Direction.Right

            MaterialUtils.ChangeMaterialColor(beatMat, gm.diffuseColors[3]);
            MaterialUtils.ChangeMaterialEmission(beatMat, gm.emissiveColors[3], gm.emissiveIntensities[3]);

            MaterialUtils.ChangeMaterialColor(markerMat, gm.diffuseColors[3]);
            MaterialUtils.ChangeMaterialEmission(markerMat, gm.emissiveColors[3], gm.emissiveIntensities[3]);
            break;

        case BoxColor.Blue:
            xOffset = xOffsetRef;
            if (hitDir == Direction.Right)
            {
                hitDir = Direction.Left;
            }

            MaterialUtils.ChangeMaterialColor(beatMat, gm.diffuseColors[1]);
            MaterialUtils.ChangeMaterialEmission(beatMat, gm.emissiveColors[1], gm.emissiveIntensities[1]);

            MaterialUtils.ChangeMaterialColor(markerMat, gm.diffuseColors[1]);
            MaterialUtils.ChangeMaterialEmission(markerMat, gm.emissiveColors[1], gm.emissiveIntensities[1]);


            break;

        case BoxColor.Green:
            xOffset = xOffsetRef;
            if (hitDir == Direction.Right)
            {
                hitDir = Direction.Left;
            }

            MaterialUtils.ChangeMaterialColor(beatMat, gm.diffuseColors[2]);
            MaterialUtils.ChangeMaterialEmission(beatMat, gm.emissiveColors[2], gm.emissiveIntensities[2]);

            MaterialUtils.ChangeMaterialColor(markerMat, gm.diffuseColors[2]);
            MaterialUtils.ChangeMaterialEmission(markerMat, gm.emissiveColors[2], gm.emissiveIntensities[2]);
            break;
        }
    }