private void OpenLoudspeaker() { if (loudspeakerView == null) { //show LoudspeakerUI GameResourceLoadManager.GetInstance().LoadAssetAsync("LoudspeakerUI", delegate(GameObject data) { GameObject obj = Instantiate(data) as GameObject; loudspeakerView = obj.AddComponent <LoudspeakerView>(); ChangeUIViewDepthBySetParent(loudspeakerView.gameObject.transform, UIMenuDepth.Loudspeaker); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; RectTransform rectTrans = obj.GetComponent <RectTransform>(); rectTrans.sizeDelta = Vector2.zero; loudspeakerView.ShowLoudspeakerPanel(); }); } else { loudspeakerView.gameObject.SetActive(true); loudspeakerView.ShowLoudspeakerPanel(); } }
public LoudspeakerControler(LoudspeakerView v) { view = v; dataManager = DataManager.GetInstance(); //MessageDispatcher.AddObserver( OpenLoudspeaker, Constants.MessageType.OpenLoudspeakerView ); NetworkManager.RegisterServerMessageHandler(ServerType.SocialServer, MsgCode.SendChatMessage, HandleSendChatFeedback); }