Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. ............This part is inside the public class.........................
  2.  
  3.         List<string> TextAssetToList(TextAsset textFile)
  4.         {
  5.            
  6.             return new List<string>(textFile.text.Split('\n'));
  7.  
  8.         }
  9.  
  10.  
  11. ............................This part is inside the Void awake, where the hardcoded values were............
  12.  
  13.         { //HALLILUYAH! TEXT FILE READ HERE AND PUT INTO GRAPH!
  14.            
  15.             TextAsset File = Resources.Load("File") as TextAsset; //turning text asset into string list
  16.  
  17.             List<string> valueListTXT = TextAssetToList(textFile);
  18.  
  19.             valueListTXT.RemoveAll(item => item.Length == 0);
  20.  
  21.  
  22.             List<int> valueList = valueListTXT.Select(x => int.Parse(x)).ToList();
  23.            
  24.             ShowGraph(valueList, LineGraphVisual, -1, (int _i) => "" + (_i + 1), (float _f) => Mathf.RoundToInt(_f) + "°c");
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement