Exemple #1
0
 public HomeViewModel()
 {
     Title       = "EStore";
     command     = new AsyncCommand(add);
     Addcommand  = new Command(async(object obj) => await Addcommands(obj as Product));
     pansManager = new PanManager();
 }
        //        public void OnApplicationPause(bool pause)
        //        {
        //#if UNITY_IPHONE || UNITY_ANDROID

        //#endif
        //        }

        //        private double loseFocusTime = 0;
        //        public void OnApplicationFocus(bool focus)
        //        {
        //#if UNITY_IPHONE || UNITY_ANDROID
        //            if (!focus)
        //            {
        //                //失去焦点
        //                loseFocusTime = Util.GetTimeStamp();
        //            }
        //            else
        //            {
        //                //获得焦点
        //                if (loseFocusTime > 0)
        //                {
        //                    //Util.CallMethod("GlobalListener", "OnApplicationFocusManager", Util.GetTimeStamp() - loseFocusTime);
        //                }
        //            }
        //#endif
        //        }


        private void ConfigFileInit()
        {
            string url = Util.AppContentPath() + filesStr;

            if (File.Exists(url))
            {
                string[] fill  = File.ReadAllLines(url);
                string   key   = null;
                string   value = null;
                foreach (var item in fill)
                {
                    var configKeyValue = item.Trim().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    key   = configKeyValue[0].Trim();
                    value = configKeyValue[1].Trim();
                    fileDic.Add(key, value);
                }
                fileDic.TryGetValue("ip", out AppConst.Port);
                //
                AppConst.IP           = string.Format(AppConst.IP, AppConst.Port);
                AppConst.WebSocketAdd = string.Format(AppConst.WebSocketAdd, AppConst.Port);
                NetManager.InitNet();
                ResManager.Initialize();
                PanManager.OpenPanel <LobbyPanel>(PanelName.LobbyPanel);
            }
            else
            {
                StartCoroutine(Init());
            }
        }
 void OnClickEditTogglr(bool isOn)
 {
     if (isOn)
     {
         videoRoot.SetActive(false);
         PanManager.OpenPanel <ControlPanel>(PanelName.ControlPanel);
     }
 }
 void OnClickHomeToggle(bool isOn)
 {
     if (isOn)
     {
         videoRoot.SetActive(true);
         PanManager.ClosePanel(PanelName.ControlPanel);
     }
 }
Exemple #5
0
        public ShowClientViewModel()
        {
            Title      = "save";
            Item       = DataManager.GetCliente();
            panManager = new PanManager();

            if (Item == null)
            {
                Item = new Client();
            }
        }
Exemple #6
0
 void OnClickConnect()
 {
     if (string.IsNullOrEmpty(serveInput.text))
     {
         PanManager.ShowToast("请输入服务器IP+端口");
         return;
     }
     AppConst.WebSocketAdd = string.Format(AppConst.WebSocketAdd, serveInput.text);
     AppConst.IP           = string.Format(AppConst.IP, serveInput.text);
     NetManager.InitNet();
     PanManager.OpenPanel <LobbyPanel>(PanelName.LobbyPanel);
 }
Exemple #7
0
    void OnClickBack()
    {
        AdminMessage msg = new AdminMessage();

        msg.Type         = DataType.AdminEvent;
        msg.Data.Control = ControlState.Stop;
        NetManager.SendMessage(Util.ObjectToJson(msg));
        mediaPlayer.Stop();
        videoPLayerRoot.gameObject.SetActive(false);
        PanManager.AllOpenWithout(PanelName.VideoPlayPanel);
        PanManager.ClosePanel(PanelName.VideoPlayPanel);
    }
 private void PlayLocal()
 {
     if (currentChooseVideoUrl == null)
     {
         PanManager.ShowToast("您还没选择视频");
         return;
     }
     PanManager.OpenPanel <VideoPlayPanel>(PanelName.VideoPlayPanel, currentChooseVideoUrl);
     currentChooseItem.isOn = false;
     currentChooseVideoUrl  = null;
     PanManager.AllHidenWithout(PanelName.VideoPlayPanel);
 }
    private void PlayAllNet()
    {
        if (currentChooseVideoUrl == null)
        {
            PanManager.ShowToast("您还没选择视频");
            return;
        }
        AdminMessage msg = new AdminMessage();

        msg.Type                      = DataType.AdminEvent;
        msg.Data.Control              = ControlState.Play;
        msg.Data.Progress             = 0;
        msg.Data.Resource.Id          = currentChooseVideoId;
        msg.Data.Resource.Uri         = currentChooseVideoUrl;
        msg.Data.Resource.FileType.Id = currentChooseFileType;
        msg.Data.Resource.Md5         = currentChooseMd5;
        NetManager.SendMessage(Util.ObjectToJson(msg));
        PanManager.OpenPanel <VideoPlayPanel>(PanelName.VideoPlayPanel, currentChooseVideoUrl);
        currentChooseItem.isOn = false;
        currentChooseVideoUrl  = null;

        PanManager.AllHidenWithout(PanelName.VideoPlayPanel);
    }