12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class Follower
- {
- public int userId;
- public ChatMsgEvent OnMsgAdded;
- private string lastMsg = "";
- private System.DateTime dateTime;
- public int newMsgCount = 0;
- public Follower()
- {
- OnMsgAdded = new ChatMsgEvent ();
- }
- public List<ChatMsg> GetMsgList()
- {
- return ChatManager.GetInstance().GetFollowMsgList(userId);
- }
- public void AddMsg(ChatMsg chatMsg)
- {
- lastMsg = chatMsg.content;
- dateTime = chatMsg.dateTime;
- newMsgCount++;
- OnMsgAdded.Invoke (chatMsg);
- }
- public void ResetMsgCount()
- {
- newMsgCount = 0;
- }
- public string GetLastMsg()
- {
- return lastMsg;
- }
- public string GetLastMsgTime()
- {
- if(dateTime == null)
- return "";
- return dateTime.ToString();
- }
- }
|