SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top