Exemplo n.º 1
0
    private void SetColor(string name, RubicColors rubicColor, bool shouldBeEnabled)
    {
        var col    = ColorDetection.UnityColorFromEnum(rubicColor);
        var obj    = transform.Find(name);
        var render = obj.GetComponent <Renderer>();

        render.enabled = shouldBeEnabled;

        render.material.color = col;
    }
Exemplo n.º 2
0
        public static Color UnityColorFromEnum(RubicColors c)
        {
            switch (c)
            {
            case RubicColors.White: return(Color.white);

            case RubicColors.Red: return(Color.red);

            case RubicColors.Green: return(Color.green);

            case RubicColors.Blue: return(Color.blue);

            case RubicColors.Yellow: return(Color.yellow);

            case RubicColors.Orange: return(new Color(1f, 0.39f, 0f));

            case RubicColors.Black: return(Color.black);

            default:
                throw new ArgumentOutOfRangeException("c", c, null);
            }
        }
Exemplo n.º 3
0
 public ScanningInstruction(RubicColors faceColor, RubicColors topColor)
 {
     FaceColor = faceColor;
     TopColor  = topColor;
 }
Exemplo n.º 4
0
    private void SetColor(Transform trans, RubicColors c)
    {
        var material = trans.GetComponent <Renderer>().material;

        material.color = ColorDetection.UnityColorFromEnum(c);
    }
Exemplo n.º 5
0
 public void SetNewInstruction(RubicColors facingColor, bool inverse = false, bool doubleMove = false)
 {
     FacingColor.material.color = ColorDetection.UnityColorFromEnum(facingColor);
     Arrow.flipX   = !inverse;
     TextMesh.text = doubleMove ? "180°" : "90°";
 }