-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMessagePrefab.cs
53 lines (49 loc) · 1.53 KB
/
MessagePrefab.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MessagePrefab : MonoBehaviour {
public GameObject redPoint;
public Text titleText;
public Text infoText;
public Text timeText;
public string str;
public string hax;
public int index;
public string timeStr;
public string dataStr;
public MessageCenter.MessageType type;
public void ShowDetailPage()
{
MessageCenter.instance.ShowMessageDetailPage(this);
//if(redPoint.activeInHierarchy)
//{
// string newStr = dataStr.Replace("|0|", "|1|");
// PlayerPrefs.SetString("message" + index, newStr);
// redPoint.gameObject.SetActive(false);
// int bage = MessageInfo.RefreshBage();
// JPushManage.instance.messageInfo.SetBage(bage);
// JPushManage.instance.mainPanel.SetRedPoint(bage);
//}
}
public void Init(string title,string time,string fromOrTo,string content,string hash,int _index,string _type,string isReaded)
{
if (isReaded == "0")
{
redPoint.SetActive(true);
}
else
redPoint.SetActive(false);
titleText.text = title;
timeText.text = MessageCenter.GetDateFromString(time);
timeStr = time;
infoText.text = fromOrTo;
str = content;
hax = hash;
index = _index;
if(_type.IndexOf("BTC") >= 0)
{
type = MessageCenter.MessageType.BTC;
}
}
}