Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        StreamReader reader = new StreamReader("Assets/CSV/BookDetail.csv");

        File = new TextAsset(reader.ReadToEnd());
        Table.Load(File);
        Debug.Log(File.text);
        ListBook = Table.GetRowList();
        reader.Close();

        StreamReader readeritem = new StreamReader("Assets/CSV/AllItems.csv");

        FileItem = new TextAsset(readeritem.ReadToEnd());
        TableItem.Load(FileItem);
        Debug.Log(FileItem.text);
        ListItem = TableItem.GetRowList();
        readeritem.Close();

        StreamReader readermini = new StreamReader("Assets/CSV/MiniGame.csv");

        Filemini = new TextAsset(readermini.ReadToEnd());
        Tablemini.Load(Filemini);
        Debug.Log(Filemini.text);
        Listmini = Tablemini.GetRowList();
        readermini.Close();
    }
Пример #2
0
    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();
            }
        }
    }
Пример #3
0
    // 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();
    }
Пример #4
0
    // 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();
    }
Пример #5
0
    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);
        }
    }