forked from googlevr/gvr-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataReader.cs
More file actions
57 lines (40 loc) · 1.29 KB
/
DataReader.cs
File metadata and controls
57 lines (40 loc) · 1.29 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
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
public class GeometryReader {
private static Dictionary<string, Dictionary<string,string>> mDict = new Dictionary<string, Dictionary<string,string>> ();
public static string dataToDisplay = string.Empty;
// Use this for initialization
public static void Start () {
mDict.Clear ();
string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Ana\Documents\GitHub\cardboard-java\RevitData.txt");
foreach (var line in lines) {
Dictionary<string,string> geoDict= new Dictionary<string, string>();
string[] objectData = line.Split(',');
string elemId=string.Empty;
foreach (var od in objectData) {
string[] subdata= od.Split(':');
if(subdata[0]=="ElementId"){
elemId=subdata[1];
continue;
}
geoDict.Add(subdata[0],subdata[1]);
}
mDict.Add (elemId,geoDict);
}
Debug.Log(mDict);
}
// Update is called once per frame
void Update () {
}
public static void getObjectInfo(){
string ElementId = "124590";
//extend this tomorrow with filters
dataToDisplay = string.Empty;
Dictionary<string, string> objectData = mDict[ElementId];
foreach (string key in objectData.Keys) {
dataToDisplay+= objectData[key] + "\n";
}
}
}