private void createGroundBubbles(Vector3[] positions, int height, Texture2D tex) { Bubble bubble; for (int i = 0; i < positions.Length; i++) { Vector3 pos = new Vector3(positions[i].x, positions[i].y + height, positions[i].z); //Debug.Log(pos); bubble = new Bubble(pos, tex, bubbleAverageColor); bubbles.Add(bubble); //createBubble(positions[i], height); } }
private void createPlatformBubbles(Vector3 position, int width, Texture2D tex) { position = new Vector3(position.x - 2, position.y + 1, position.z); for (int j = 0; j < width; j++) { for (int i = width - j; i > 0; i--) { //Bubble bubble = new Bubble( Vector2 pos = new Vector2(i + j / 2f + position.x, j + position.y); Bubble bubble = new Bubble(pos, tex, bubbleAverageColor); bubbles.Add(bubble); // /// ///// } } //for (int y = width; y > 0; y--) //{ // for (int x = width; x > 0; x--) // { // } //} }
private void createPlatformBubbles(Vector3 position, int width, Texture2D tex) { position = new Vector3(position.x - 2, position.y + 1, position.z); for (int j = 0; j < width; j++) { for (int i = width - j; i > 0; i--) { //Bubble bubble = new Bubble( Vector2 pos = new Vector2(i + j/2f + position.x, j + position.y); Bubble bubble = new Bubble(pos, tex, bubbleAverageColor); bubbles.Add(bubble); // /// ///// } } //for (int y = width; y > 0; y--) //{ // for (int x = width; x > 0; x--) // { // } //} }