public void init() { mHero = GameObject.Find("Manager").GetComponent <LevelManager>().mPlayerControl; xMin = JsonUtils.getIntance().getConfigValueForId(100034); xMax = JsonUtils.getIntance().getConfigValueForId(100035); yMax = JsonUtils.getIntance().getConfigValueForId(100036); ymin = JsonUtils.getIntance().getConfigValueForId(100037); xDistance = (xMax - xMin) / 6; yDistance = (yMax - ymin) / 6; for (int i = 0; i < 3; i++) { for (int ii = 0; ii < 3; ii++) { PetLocalDate local = new PetLocalDate(); local.x = xMin + (ii * 2 + 1) * xDistance; local.y = ymin + (i * 2 + 1) * xDistance; local.id = -1; mLocalList.Add(local); } } //reInit(); }
IEnumerator FadePlay() { SteamVR_Fade.Start(Color.black, 1.0f); GameObject ozo_cam = GameObject.Find("OZO_Camera"); PlayControl player = ozo_cam.GetComponentInChildren <PlayControl>(); if (StreamingAssets_VideoPath != null) { if (File.Exists(StreamingAssets_VideoPath)) { player._videoFiles[0] = StreamingAssets_VideoPath; } else { player._videoFiles[0] = "asset://placeholder.vrmp4"; } } player._startPlay = true; player._play.SetVisible(false); yield return(new WaitForSeconds(1.0f)); Camera.allCameras[0].cullingMask = 0; player._play.SetVisible(true); }
// Use this for initialization void Start() { myButton = GameObject.Find("myButton"); startUI = GameObject.Find("Start_UI"); gameUI = GameObject.Find("Game_UI"); stopUI = GameObject.Find("Stop_UI"); myPlayer = GameObject.Find("cube_box").GetComponent <PlayControl>(); start_moveText = GameObject.Find("moveBestScore").GetComponent <UILabel>(); star_awardText = GameObject.Find("awardNowScore").GetComponent <UILabel>(); game_awardText = GameObject.Find("awardGameScore").GetComponent <UILabel>(); game_moveText = GameObject.Find("moveNowScore").GetComponent <UILabel>(); if (PlayerPrefs.GetInt("awardScore", 0) > 100) { PlayerPrefs.SetInt("awardScore", 100); } star_awardText.text = PlayerPrefs.GetInt("awardScore", 0).ToString() + "/100"; start_moveText.text = PlayerPrefs.GetInt("moveScore", 0).ToString(); game_moveText.text = "0"; startUI.SetActive(true); gameUI.SetActive(false); stopUI.SetActive(false); UIEventListener.Get(myButton).onClick = StartButton; }
// Use this for initialization void Start() { player = GameObject.FindObjectOfType <PlayControl>(); game = GameObject.FindObjectOfType <GameControl>(); sprite = gameObject.GetComponent <SpriteRenderer>(); yValue = transform.position.y; }
private void RemoveVideoView(PlayerView videoView) { try { var parent = (ViewGroup)videoView.Parent; if (parent == null) { return; } var index = parent.IndexOfChild(videoView); if (index < 0) { return; } parent.RemoveViewAt(index); IsVideoViewAdded = false; PlayControl.SetOnClickListener(null); } catch (Exception e) { Console.WriteLine(e); } }
public static void Initialize() { WMP = new WindowsMediaPlay(); playControl = AppPropertys.mainWindow.playControl1; DT.Interval = TimeSpan.FromMilliseconds(100); DT.Tick += new EventHandler(DT_Tick); }
public void Init() { if (isMoreSpeed) { PlayControl.SetSpeed(ShopPanel.GetSpeedTimes()); ControlinPlay.SetSpeed(ShopPanel.GetSpeedTimes()); } }
// Use this for initialization void Start() { levelManger = GameObject.FindObjectOfType <LevelManager> (); playControl = GameObject.FindObjectOfType <PlayControl> (); healthText.text = "Health: " + health.ToString(); totalHealth = health; resumeButton.SetActive(true); }
void Start() { startPosition = gameObject.GetComponent <Transform>().position; myPosition = gameObject.GetComponent <Transform>(); myPlayer = GameObject.Find("cube_box").GetComponent <PlayControl>(); }
public void StartTest3() { PlayControl target = new PlayControl(); count = 0; target.Stop(); target.Start(() => TestAction()); Thread.Sleep(200); Assert.AreEqual(PlayControl.States.Playing, target.State); target.Stop(); }
public void ErrorTest() { PlayControl target = new PlayControl(); target.Failed += new EventHandler <PlayControlFailedEventArgs>(target_Failed); _FailedException = null; count = 0; target.Start(() => ErrorAction()); Thread.Sleep(200); Assert.AreEqual(PlayControl.States.Error, target.State); Assert.IsTrue(_FailedException is System.IO.IOException); }
/// <summary> /// Connects a KeyCode to a UserInput value and returns if it had to overwrite something /// </summary> /// <param name="KeyCode">The KeyCode to look for</param> /// <param name="UserInput">The type of user input to execute</param> /// <returns>Was a pre-existing value overwritten</returns> public bool StorePlayerData(KeyCode kc, Player.UserInput ui) { if (PlayControl.ContainsKey(kc)) { PlayControl[kc] = ui; return(true); } else { PlayControl.Add(kc, ui); return(false); } }
public void StopTest() { PlayControl target = new PlayControl(); count = 0; target.Start(() => TestAction()); Thread.Sleep(200); target.Stop(); //allow some time for the thread to change state Thread.Sleep(200); Assert.IsTrue(count > 0); Assert.AreEqual(PlayControl.States.Stopped, target.State); CheckCountNotIncreasing(); }
public void PauseTest() { #if DEBUG PlayControl target = new PlayControl(); count = 0; target.Start(() => TestAction()); Thread.Sleep(1000); target.Pause(); //allow some time for the thread to change state Thread.Sleep(1000); Assert.IsTrue(count > 0); Assert.AreEqual(PlayControl.States.Paused, target.State); CheckCountNotIncreasing(); #endif }
/*I'm Not Using This Right Now*/ IEnumerator FadeStop() { SteamVR_Fade.Start(Color.clear, 1.0f); GameObject ozo_cam = GameObject.Find("OZO_Camera"); PlayControl player = ozo_cam.GetComponentInChildren <PlayControl>(); player._play.SetVisible(false); player._startPlay = false; player._play.Stop(); Camera.allCameras[0].cullingMask = -1; yield return(new WaitForSeconds(0.0f)); }
// Use this for initialization void Start() { //动态获取资源 myFloor = Resources.Load("tile_white") as GameObject; myWall = Resources.Load("wall2") as GameObject; myHole = Resources.Load("NULL") as GameObject; mySpike_1 = Resources.Load("moving_spikes") as GameObject; mySpike_2 = Resources.Load("smashing_spikes") as GameObject; myAward = Resources.Load("gem 2") as GameObject; //获取角色控制脚本 pc = GameObject.Find("cube_box").GetComponent <PlayControl>(); myTransform = gameObject.GetComponent <Transform>(); Create(0); }
/// <summary> /// select option chnged /// </summary> /// <param name="sender">object sender</param> /// <param name="e">eventargs e</param> private void Options_SelectionChanged(object sender, SelectionChangedEventArgs e) { string selection = Options.SelectedItem.ToString(); int IndexStart = selection.IndexOf(":"); selection = selection.Substring(IndexStart + 2); // after the : and the space, then +2 switch (selection) { case "Display Maze": { Grid_generate.Children.Clear(); DisplayControl dis_c = new DisplayControl(m_model, m_view); Grid_generate.Children.Add(dis_c); break; } case "Display Solution": { Grid_generate.Children.Clear(); DisplaySol dis_s = new DisplaySol(m_model, m_view); Grid_generate.Children.Add(dis_s); break; } case "Solve Maze": { Grid_generate.Children.Clear(); SolveWindow solve_w = new SolveWindow(m_model, m_view); solve_w.Show(); break; } case "Play": { e.Handled = true; Grid_generate.Focus(); Grid_generate.Children.Clear(); play = new PlayControl(m_model, m_view); Grid_generate.Children.Add(play); break; } } }
public ResponseData SetImage(string key, string value) { var task = Task.Run(() => { PlayControl play = ScreenUtil.GetControl(key); if (play.PlayLock) { play.PlayLock = false; play.Type = "img"; play.Value = value; return(200); } return(204); }); return(new ResponseData { Code = task.Result, Success = true, Data = "显示图片成功!" }); }
/// <summary> /// /// </summary> /// <param name="timeoutSecond">延时时间</param> /// <param name="play">控制器</param> /// <returns></returns> public bool InfoHandlerDelay(int timeoutSecond, PlayControl play) { //循环间隔 TimeSpan mill = TimeSpan.FromMilliseconds(500); //循环次数 var count = timeoutSecond * 1000 / mill.Milliseconds; for (var i = 0; i < count; i++) { var task = Task.Delay(mill); task.Wait(); if (!play.PlayLock) { return(true); } } return(false); }
public HttpResponseMessage GetInfo(object state, string key) { var response = HResponse("没有返回内容", HttpStatusCode.NoContent); PlayControl play = ScreenUtil.GetControl(key); int nowTimes = 0; int maxTimes = 100; while (++nowTimes <= maxTimes) { if (!play.PlayLock) { play.PlayLock = true; response = HResponse(JsonConvert.SerializeObject(play), HttpStatusCode.OK); break; } Thread.Sleep(100); } return(response); }
private void UpdateCans() { if ( null == TheController || null == TheController.Sources || null == Zone || null == Zone.SelectedInput) { Control = new PlayControl(); return; } var source = TheController.Sources.FirstOrDefault(s => s.SourceName == Zone.SelectedInput.Src_Name); if (null == source || null == source.Control) { Control = new PlayControl(); return; } Control = source.Control; }
void PlayLoop() { m_PlayControl = new PlayControl(); m_PlayControl.Reset(); while (!m_Stop) { while (m_Play) { if (m_PlayControl.intervalCounter >= (int)m_PlayControl.interval.TotalMilliseconds) { lock (jpegArrayLock) { m_PlayControl.previousFrameTime = PATHS.GetTimeFromFile(jpegsToPlay[m_JpegPlayIndex]); } this.BeginInvoke((MethodInvoker) delegate { this.PushNextJpeg(); }); if (m_JpegPlayIndex == jpegsToPlay.Length - 1) { m_Play = false; this.BeginInvoke((MethodInvoker) delegate { this.StopPlay(); }); continue; } DateTime nexttimestamp = PATHS.GetTimeFromFile(jpegsToPlay[m_JpegPlayIndex + 1]); m_PlayControl.interval = nexttimestamp.Subtract(m_PlayControl.previousFrameTime); m_JpegPlayIndex++; m_PlayControl.intervalCounter = 0; } if (m_Stop) { break; } TimeSpan playtime = m_PlayControl.interval.Add(new TimeSpan(0, 0, 0, 0, m_PlayControl.intervalCounter)); this.BeginInvoke((MethodInvoker) delegate { this.PushPlayStats(m_PlayControl.previousFrameTime.Add(playtime).ToString(m_AppData.TimeFormatStringForFileNames), m_PlayControl.previousFrameTime.ToString(m_AppData.TimeFormatStringForFileNames)); }); m_PlayControl.intervalCounter++; Thread.Sleep(1); } Thread.Sleep(1); } }
private PlayControl ParseControl(XElement m) { var control = new PlayControl(); foreach (var el in m.Elements()) { if (el.CompareAttributeVal("Func", "Playback")) { foreach (var child in el.Elements("Put_1")) { if (child.CompareAttributeVal("Func", "Play")) { control.CanPlay = true; } else if (child.CompareAttributeVal("Func", "Pause")) { control.CanPause = true; } else if (child.CompareAttributeVal("Func", "Stop")) { control.CanStop = true; } } } else if (el.CompareAttributeVal("Func", "Plus_Minus") && el.CompareAttributeVal("Title_1", "Skip")) { foreach (var child in el.Elements("Put_1")) { if (child.CompareAttributeVal("Func", "Plus_1")) { control.CanNext = true; } else if (child.CompareAttributeVal("Func", "Minus_1")) { control.CanPrev = true; } } } } return(control); }
public void PlayTest() { #if DEBUG PlayControl target = new PlayControl(); count = 0; target.Start(() => TestAction()); Thread.Sleep(200); target.Pause(); //allow some time for the thread to change state Thread.Sleep(200); int countCheck = count; target.Play(); //allow some time for the thread to change state Thread.Sleep(300); Assert.AreEqual(PlayControl.States.Playing, target.State); //check that count is increasing Assert.IsTrue(count > countCheck); target.Stop(); #endif }
void InitOtherControls() { jpegArrayLock = new object(); m_ThreadTable = new ThreadControlTable(); dateTimeStartTime.Format = DateTimePickerFormat.Custom; dateTimeStartTime.CustomFormat = m_timeFormat; dateTimeEndTime.Format = DateTimePickerFormat.Custom; dateTimeEndTime.CustomFormat = m_timeFormat; trackBar1.SetRange(0, 100); m_PlayControl = new PlayControl(); m_JpegPlayThread = new Thread(PlayLoop); m_JpegPlayThread.Start(); m_WallClock = new Thread(WallClockLoop); m_WallClock.Start(); }
private void OnTriggerExit(Collider other) { /*Fade The Camera Back to World and Stop Video*/ if (other.gameObject.tag == "Head") { print("ON STOP TRIGGER EXIT"); if (corout != null) { StopCoroutine(corout); } SteamVR_Fade.Start(Color.clear, 1.0f); GameObject ozo_cam = GameObject.Find("OZO_Camera"); PlayControl player = ozo_cam.GetComponentInChildren <PlayControl>(); player._play.SetVisible(false); player._startPlay = false; player._play.Stop(); Camera.allCameras[0].cullingMask = -1; } }
void PlayLoop() { m_PlayControl = new PlayControl(); m_PlayControl.Reset(); while (!m_Stop) { while (m_Play) { if (m_PlayControl.intervalCounter >= (int)m_PlayControl.interval.TotalMilliseconds) { lock (jpegArrayLock) { m_PlayControl.previousFrameTime = PATHS.GetTimeFromFile(jpegsToPlay[m_JpegPlayIndex]); } this.BeginInvoke((MethodInvoker)delegate { this.PushNextJpeg(); }); if (m_JpegPlayIndex == jpegsToPlay.Length - 1) { m_Play = false; this.BeginInvoke((MethodInvoker)delegate { this.StopPlay(); }); continue; } DateTime nexttimestamp = PATHS.GetTimeFromFile(jpegsToPlay[m_JpegPlayIndex + 1]); m_PlayControl.interval = nexttimestamp.Subtract(m_PlayControl.previousFrameTime); m_JpegPlayIndex++; m_PlayControl.intervalCounter = 0; } if (m_Stop) break; TimeSpan playtime = m_PlayControl.interval.Add(new TimeSpan(0, 0, 0, 0, m_PlayControl.intervalCounter)); this.BeginInvoke((MethodInvoker)delegate { this.PushPlayStats(m_PlayControl.previousFrameTime.Add(playtime).ToString(m_AppData.TimeFormatStringForFileNames), m_PlayControl.previousFrameTime.ToString(m_AppData.TimeFormatStringForFileNames)); }); m_PlayControl.intervalCounter++; Thread.Sleep(1); } Thread.Sleep(1); } }
private void UpdatePlayButtons(PlayControl button) { tsbPlay.BackgroundImage = ToolStripManager.GetBackground((button & PlayControl.Play) == PlayControl.Play); tsbPlayPoint.BackgroundImage = ToolStripManager.GetBackground((button & PlayControl.PlayPoint) == PlayControl.PlayPoint); tsbPlayRange.BackgroundImage = ToolStripManager.GetBackground((button & PlayControl.PlayRange) == PlayControl.PlayRange); tsbPause.BackgroundImage = ToolStripManager.GetBackground((button & PlayControl.Pause) == PlayControl.Pause); tsbPause.Enabled = tsbStop.Enabled = (button != PlayControl.Nothing); }
public VMPlayback(VMZone zone) : base(zone.TheController) { Zone = zone; Control = new PlayControl(); }
public void StartTest1() { PlayControl target = new PlayControl(); target.Start(null); }
// Use this for initialization void Start() { controller = GetComponentInParent <PlayControl> (); }
/// <summary> /// 播放控制 /// </summary> /// <param name="id">终端id</param> /// <param name="con">控制模式</param> /// <param name="pos">跳转模式</param> /// <returns></returns> public static bool FilePlayControl(int id, PlayControl con, int pos = 0) { return(FilePlayCtrl(id, (int)con, pos)); }