Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Chart : MonoBehaviour {
- public Transform barPrefab;
- public int width;
- public int height;
- public List<List<float>> table;
- // Use this for initialization
- void Start () {
- int counter = 1;
- for(int row = 0; row < height; row++)
- {
- List<float> r = new List<float>();
- for (int col = 0; col < width; col++)
- {
- if (col == 0)
- {
- r.Add(row + 1);
- }
- else
- {
- r.Add(Random.Range(0.0f, 10.0f));
- }
- }
- table.Add(r);
- }
- }
- // Update is called once per frame
- void Update () {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement