Hello everyong,
I'm having an issue with updating dictionary values or maybe not understanding scope properly. Brief overview, this a simple little puzzle game where you have to click and swap around cubes.
As a property of a class I have :
private struct CubeData { public string color; public float size; public int position; };
// Game state
private GameObject cubeSelected;
private Dictionary<string, CubeData> cubeState = new Dictionary<string, CubeData>
{
{ "Cube_1_1", new CubeData { color = "orange", size = 0.8f, position = 1 } },
{ "Cube_1_2", new CubeData { color = "opaque", size = 0.5f, position = 2 } },
{ "Cube_1_3", new CubeData { color = "opaque", size = 0.3f, position = 3 } },
{ "Cube_1_4", new CubeData { color = "opaque", size = 0.4f, position = 4 } },
{ "Cube_1_5", new CubeData { color = "orange", size = 0.7f, position = 5 } },
{ "Cube_1_6", new CubeData { color = "opaque", size = 0.6f, position = 6 } },
{ "Cube_1_7", new CubeData { color = "orange", size = 0.5f, position = 7 } },
{ "Cube_1_8", new CubeData { color = "orange", size = 0.2f, position = 8 } },
{ "Cube_2_1", new CubeData { color = "opaque", size = 0.2f, position = 9 } },
{ "Cube_2_2", new CubeData { color = "orange", size = 0.5f, position = 10 } },
{ "Cube_2_3", new CubeData { color = "opaque", size = 0.7f, position = 11 } },
{ "Cube_2_4", new CubeData { color = "orange", size = 0.6f, position = 12 } },
{ "Cube_2_5", new CubeData { color = "orange", size = 0.3f, position = 13 } },
{ "Cube_2_6", new CubeData { color = "orange", size = 0.4f, position = 14 } },
{ "Cube_2_7", new CubeData { color = "opaque", size = 0.5f, position = 15 } },
{ "Cube_2_8", new CubeData { color = "opaque", size = 0.8f, position = 16 } }
};