private void Awake() { StreamReader reader = new StreamReader("Assets/CSV/MiniGame.csv"); File = new TextAsset(reader.ReadToEnd()); Table.Load(File); Debug.Log(File.text); GameData = Table.Find_ID(ID_MiniGame); StreamReader readerItem = new StreamReader("Assets/CSV/AllItems.csv"); FileItem = new TextAsset(readerItem.ReadToEnd()); TableItem.Load(FileItem); foreach (string id in GameData.FindItem) { ListFindItems.Add(TableItem.Find_ID(id)); } RewardItemData = TableItem.Find_ID(GameData.Reward); reader.Close(); readerItem.Close(); if (GameData.FindItem.Count > 0) { if (GameData.FindItem[0] == null || GameData.FindItem[0] == "") { GameData.FindItem.Clear(); ListFindItems.Clear(); } } }
// Start is called before the first frame update void Start() { StreamReader readerItem = new StreamReader("Assets/CSV/AllItems.csv"); FileItem = new TextAsset(readerItem.ReadToEnd()); TableItem.Load(FileItem); DataReward = TableItem.Find_ID(ItemRewardID); readerItem.Close(); }
// Start is called before the first frame update void Start() { StreamReader reader = new StreamReader("Assets/CSV/AllItems.csv"); File = new TextAsset(reader.ReadToEnd()); Table.Load(File); Debug.Log(File.text); GameData = Table.Find_ID(ID_Item); reader.Close(); }
void Start() { myobj = new GameObject(); GameData = new ItemsTable.Row(); StreamReader reader = new StreamReader("Assets/CSV/AllItems.csv"); FileAsset = new TextAsset(reader.ReadToEnd()); Table.Load(FileAsset); Debug.Log(FileAsset.text); GameData = Table.Find_ID(ID_Item); reader.Close(); TextName.text = ID_Item; if (GameData.ImagePath != "") { Texture2D sprites = Resources.Load(GameData.ImagePath) as Texture2D; Debug.Log(sprites + "--" + GameData.ImagePath); Rect rec = new Rect(0, 0, sprites.width, sprites.height); Sprite.Create(sprites, rec, new Vector2(0, 0), 1); IMG.sprite = Sprite.Create(sprites, rec, new Vector2(0, 0), .01f); TextName.gameObject.SetActive(false); } }