/// <summary>Displays transparent cuboid for 2 secs.</summary> public void SliderPreview(float v) { if (HeightIndicator != null) { Destroy(HeightIndicator); } if (PreviewToggle.isOn && !CopyPaste.IsEnabled()) { float y = Consts.SliderValue2RealHeight(v); HeightIndicator = GameObject.CreatePrimitive(PrimitiveType.Cube); Destroy(HeightIndicator.GetComponent <BoxCollider>()); HeightIndicator.GetComponent <MeshRenderer>().material = partiallytransparent; HeightIndicator.transform.localScale = new Vector3(3f, 0.05f, 3f); HeightIndicator.transform.position = new Vector3(4 * Highlight.tile_pos.x + 2, y, 4 * Highlight.tile_pos.z + 2); Destroy(HeightIndicator, 2); } }