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; }
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); } }
public ScanningInstruction(RubicColors faceColor, RubicColors topColor) { FaceColor = faceColor; TopColor = topColor; }
private void SetColor(Transform trans, RubicColors c) { var material = trans.GetComponent <Renderer>().material; material.color = ColorDetection.UnityColorFromEnum(c); }
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°"; }