private GameObject IntCube(CubeDTO cubedto) { var newcube = Instantiate(prefabcube, transform); newcube.transform.position = new Vector3(cubedto.position.x * _WidhtCube, cubedto.position.y * _WidhtCube, cubedto.position.z * _WidhtCube); newcube.SendMessage("IntCube", (object)cubedto); newcube.SetActive(false); return(newcube); }
private Trap SetTrap(CubeDTO cubedto) { if (IsSimpleNumber(cubedto.id.x) || IsSimpleNumber(cubedto.id.y) || IsSimpleNumber(cubedto.id.z)) { int index = Random.Range(0, Traps.Count - 1); return(new Trap() { id = index, name = Traps[index].name }); } return(null); }
public void IntCube(object cubee) // CubeDTO { cube = (CubeDTO)cubee; int index = 0; foreach (var item in walls) { item.SendMessage("IntWall", new Wall() { id = index, number = cube.id, color = cube.Color }); index++; } lightt.color = cube.Color; }
public void IntCube(object cubee) // CubeDTO { cube = (CubeDTO)cubee; int index = 0; foreach (var item in walls) { Wall wall = new Wall(); wall.id = index; wall.number = cube.id; wall.color = cube.Color; item.SendMessage("IntWall", (object)wall); index++; } lightt.color = cube.Color; }
private void LoadSampleData() { ViolationsCollection = new CubeDTO[4]; for (int i = 1; i <= 4; i++) { CubeDTO cdto = new CubeDTO(); cdto.LegendName = "C" + i.ToString(); cdto.Details = new CubeDetailsDTO[12]; for (int j = 1; j <= 12; j++) { CubeDetailsDTO cddto = new CubeDetailsDTO(); cddto.Key = "M" + j.ToString(); cddto.Value = j * 5 % 3; cdto.Details[j - 1] = cddto; } ViolationsCollection[i - 1] = cdto; } }
private void SetCubes() { for (int i = 0; i < _Size; ++i) { for (int j = 0; j < _Size; ++j) { for (int l = 0; l < _Size; ++l) { var cubee = new CubeDTO(); cubee.Color = GetColor(Random.Range(0, 6)); cubee.id = new Vector3Int(); cubee.id.x = (int)Random.Range(300, 700); cubee.id.y = (int)Random.Range(300, 700); cubee.id.z = (int)Random.Range(300, 700); cubee.position = new Vector3Int(i, j, l); cubee.trap = SetTrap(cubee); cubes[i, j, l] = cubee; } } } }