private void OnMessagesEvent(string key, object values) { switch (key) { case "LatestMsgInfo": latestMsgInfo = JsonUtility.FromJson <LatestMsgInfo>((string)values); AddMsg(); break; } }
private void AddLatestMsg(string key, string Content, LogType type) { int tempIndex = GetIndexByKey(key); if (tempIndex == -1) { return; } LatestMsgInfo latestMsgInfo = new LatestMsgInfo(); latestMsgInfo.Index = tempIndex; latestMsgInfo.Type = type; latestMsgInfo.Content = Content; UIManager.Instance.OpenUIForms(EnumUIFormType.LatestMsgUIForm); MessageMgr.SendMessageToUIForm(EnumUIFormType.LatestMsgUIForm, "LatestMsgInfo", JsonUtility.ToJson(latestMsgInfo)); }
private void OnDisable() { latestMsgInfo = null; }