ChattingLabel Load() { ChattingLabel result = null; ChattingLabel obj = Resources.Load("Prefab/ChattingLabel", typeof(ChattingLabel)) as ChattingLabel; result = Instantiate(obj); result.transform.parent = contents.transform; result.transform.localPosition = Vector3.zero; result.transform.localScale = Vector3.one; result.gameObject.SetActive(false); return(result); }
public void Init() { if (m_init == false) { m_label_data = new List <LineData>(); m_Label = Load(); Network.ChatServer.OnHubConnectedCallback += OnChatConnected; Network.ChatServer.OnGroupConnectedCallback += OnChatGroupConnected; Network.ChatServer.OnHubDisconnectedCallback += OnChatDisconnect; Network.ChatServer.OnChatMsgInsertLabel += OnChatMsgInsertLabel; Network.ChatServer.OnChatPreMsgCallback += OnChatPreMsgHandler; } if (string.IsNullOrEmpty(Network.PlayerInfo.nickname) == false) { RequestChatInfo(); } m_init = true; }