123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace DataTools
- {
- [Serializable]
- public class TweetSender
- {
- [SerializeField]
- private string senderId = "Noname";
- [SerializeField]
- private string senderUserName = "@noname";
- [SerializeField]
- private Sprite senderAvatar;
- public string SenderId
- {
- get { return senderId; }
- set { senderId = value; }
- }
- public string UserName
- {
- get { return senderUserName; }
- set { senderUserName = value; }
- }
- public Sprite Avatar
- {
- get { return senderAvatar; }
- set { senderAvatar = value; }
- }
- public static List<TweetSender> GetFromTXT(string path)
- {
- List<TweetSender> list = new List<TweetSender>();
- string[] lines = System.IO.File.ReadAllLines(@path);
- TweetSender s;
- foreach (string line in lines)
- {
- string[] temp = line.Split(';');
- s = new TweetSender();
- s.SenderId = temp[0];
- s.UserName = temp[1];
- list.Add(s);
- }
- return list;
- }
- }
- }
|