//------------------------------------------------- #region Start method private void Start() { if (this.cubes.Length != 0) { for (int i = 0; i < this.cubes.Length; i++) { cubes [i].position = new Vector3(Random.Range(-this.range, this.range), Random.Range(-this.range, this.range), Random.Range(-this.range, this.range)); cubes [i].eulerAngles = new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)); SceneSerializer.AddCube(cubes[i]); } } }
//------------------------------------------------- #region OnRandomizeClicked method public void OnRandomizeClicked() { if (this.cubes.Length != 0) { SceneSerializer.Collection.cubes.Clear(); for (int i = 0; i < this.cubes.Length; i++) { cubes [i].position = new Vector3(Random.Range(-this.range, this.range), Random.Range(-this.range, this.range), Random.Range(-this.range, this.range)); cubes [i].eulerAngles = new Vector3(Random.Range(0, 360), Random.Range(0, 360), Random.Range(0, 360)); SceneSerializer.AddCube(cubes[i]); } } }