-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnas_unity.cs
More file actions
77 lines (52 loc) · 1.57 KB
/
nas_unity.cs
File metadata and controls
77 lines (52 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TextScript : MonoBehaviour
{
public Text text;
public void Start()
{
int a = 10;
int b = 4;
var c = "100";
int ran = 0;
StreamReader reader = new StreamReader("/Users/alokpandey/Desktop/aaa/nasa_data_f.csv");
data = reader.ReadLine();
// Console.WriteLine(data);
List<string> listA = new List<string>();
//to select a random planet from our data set-----------------
for(int i = 0; i < ran;i++){
data = reader.ReadLine();}
// Console.WriteLine(data);}
var values = data.Split(',');
//to add each parameter in list one by one-----------------
foreach (var item in values)
{ listA.Add(item);
}
// while (data != null){
// foreach (var item in values){
// listA.Add(item);}
// }
// Console.WriteLine(listA.Count);
//to make a variable for each parameter of planet-----------------------------
string name = listA[0];
string sun_n = listA[1];
string year = listA[2];
string orb_p = listA[3];
string radi = listA[4];
string mass = listA[5];
string temp = listA[6];
text.text = name ;
foreach (var dat in listA){
Console.WriteLine(dat);}
reader.Close();
}
public void NextTextUpdate()
{
Start();
}
public void BackTextUpdate()
{
}
}