Esempio n. 1
0
 public static bool IsSameColour(ColourManager.ColourType typeA, ColourManager.ColourType typeB)
 {
     if (typeA == typeB)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
    public static bool IsContrastingColour(ColourManager.ColourType typeA, ColourManager.ColourType typeB)
    {
        switch (typeA)
        {
        case ColourManager.ColourType.Purple:
            if (typeB == ColourManager.ColourType.Yellow)
            {
                return(true);
            }
            break;

        case ColourManager.ColourType.Blue:
            if (typeB == ColourManager.ColourType.Orange)
            {
                return(true);
            }
            break;

        case ColourManager.ColourType.Green:
            if (typeB == ColourManager.ColourType.Red)
            {
                return(true);
            }
            break;

        case ColourManager.ColourType.Yellow:
            if (typeB == ColourManager.ColourType.Purple)
            {
                return(true);
            }
            break;

        case ColourManager.ColourType.Orange:
            if (typeB == ColourManager.ColourType.Blue)
            {
                return(true);
            }
            break;

        case ColourManager.ColourType.Red:
            if (typeB == ColourManager.ColourType.Green)
            {
                return(true);
            }
            break;

        default:
            return(false);

            break;
        }
        return(false);
    }
Esempio n. 3
0
    private void StopSpinning()
    {
        while (rotationAngle < 0)
        {
            rotationAngle += 360;
        }
        while (rotationAngle > 360)
        {
            rotationAngle -= 360;
        }

        rotationAngle = (float)Mathf.RoundToInt(rotationAngle);

        faceIndex = (int)(rotationAngle / 30f);

        if (faceIndex == 12)
        {
            faceIndex = 0;
        }

        colors = colourWheelFaceColours[faceIndex].name.Split('_');

        currentColourTop    = ParseColour(colors[0]);
        currentColourBottom = ParseColour(colors[1]);

        if (ColourTop != null)
        {
            switch (currentColourTop)
            {
            case ColourManager.ColourType.Purple:
                ColourTop(currentColourTop);
                break;

            case ColourManager.ColourType.Blue:
                ColourTop(currentColourTop);
                break;

            case ColourManager.ColourType.Green:
                ColourTop(currentColourTop);
                break;

            case ColourManager.ColourType.Yellow:
                ColourTop(currentColourTop);
                break;

            case ColourManager.ColourType.Orange:
                ColourTop(currentColourTop);
                break;

            case ColourManager.ColourType.Red:
                ColourTop(currentColourTop);
                break;
            }
        }
        if (ColourBottom != null)
        {
            switch (currentColourBottom)
            {
            case ColourManager.ColourType.Purple:
                ColourBottom(currentColourBottom);
                break;

            case ColourManager.ColourType.Blue:
                ColourBottom(currentColourBottom);
                break;

            case ColourManager.ColourType.Green:
                ColourBottom(currentColourBottom);
                break;

            case ColourManager.ColourType.Yellow:
                ColourBottom(currentColourBottom);
                break;

            case ColourManager.ColourType.Orange:
                ColourBottom(currentColourBottom);
                break;

            case ColourManager.ColourType.Red:
                ColourBottom(currentColourBottom);
                break;
            }
        }


//
//		Debug.Log(currentColourTop.ToString());
//		Debug.Log(currentColourBottom.ToString());
        CameraBehaviour.Instance.Shake(0.5f, 0.0f, 1.0f, true);
        //reset variables
        rotationSpeed = 0;
        startSpinning = false;
        shake         = false;
        timer         = 0.0f;
    }
Esempio n. 4
0
 private void ColourBottom(ColourManager.ColourType colour)
 {
     BottomColour = colour;
 }
Esempio n. 5
0
 private void ColourTop(ColourManager.ColourType colour)
 {
     TopColour = colour;
 }