// Update is called once per frame void Update() { switch (ImageState) { case changeState.ChangingToBlack: ImageComponent.color = Color.Lerp(Color.white, Color.black, (fadeDuration - (Time.timeSinceLevelLoad - timeToFade))); if (timeToFade < Time.timeSinceLevelLoad) { StartImgChange(true); } break; case changeState.ChangingToImage: ImageComponent.color = Color.Lerp(Color.white, Color.white, (fadeDuration - (Time.timeSinceLevelLoad - timeToFade))); if (timeToFade < Time.timeSinceLevelLoad) { ImageState = changeState.Done; } break; case changeState.Done: // Do nothing break; } }
private void down(Object data) { List <Boolean> listviews = (List <Boolean>)data; bool needDown = false; //是否需要缺少下载工具 for (int i = 0; i < listviews.Count; i++) { if (!needDown) { if (listviews[i]) { try { String targetUrl = targetPlugin.Down(i); if (!targetPlugin.Equals(String.Empty)) { System.Diagnostics.Process.Start(targetUrl); } Thread.Sleep(1000); } catch (Win32Exception) { String keyWord = ""; String forwardUrl = ""; if (TargetUrl.Text.ToLower().Contains("tudou.com")) { keyWord = "土豆"; forwardUrl = "http://www.tudou.com/my/soft/itudou.php"; } else { keyWord = "优酷"; forwardUrl = "http://c.youku.com/pc-client"; } needDown = true; if (MessageBox.Show("你没有安装" + keyWord + "下载工具,点击确认安装。\n如果你确认你已经安装,请重启后再试。", "错误", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK) { System.Diagnostics.Process.Start(forwardUrl); } } catch (Exception ex) { MessageBox.Show(ex.GetType() + " " + ex.Message); } finally { changeState c = new changeState(ChangeState); if (DownSelectItem.InvokeRequired) { DownSelectItem.Invoke(c, new object[] { false }); } } } } } }
// Either blend the image to black or full-colour depending on if the transition has happened public void StartImgChange(bool readyForImage) { timeToFade = Time.timeSinceLevelLoad + fadeDuration; if (readyForImage) { ImageState = changeState.ChangingToImage; } else { ImageState = changeState.ChangingToBlack; } // }
public void BeginImageChange(Sprite newImage) { destinationTexture = newImage; ImageState = changeState.ChangingToBlack; }
private void down(Object data) { List<Boolean> listviews = (List<Boolean>)data; bool needDown = false; //是否需要缺少下载工具 for (int i = 0; i < listviews.Count; i++) { if (!needDown) { if (listviews[i]) { try { String targetUrl = targetPlugin.Down(i); if (!targetPlugin.Equals(String.Empty)) { System.Diagnostics.Process.Start(targetUrl); } Thread.Sleep(5000); } catch (Win32Exception) { String keyWord = "优酷"; String forwardUrl = "http://mobile.youku.com/index/pc"; if (TargetUrl.Text.ToLower().Contains("tudou.com")) { keyWord = "土豆"; forwardUrl = "http://www.tudou.com/soft/itudou.html"; } needDown = true; if (MessageBox.Show("你没有安装" + keyWord + "下载工具,点击确认安装。\n如果你确认你已经安装,请重启后再试。", "错误", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK) { System.Diagnostics.Process.Start(forwardUrl); } } catch (Exception ex) { MessageBox.Show(ex.GetType() + " " + ex.Message); } finally { changeState c = new changeState(ChangeState); if (DownSelectItem.InvokeRequired) { DownSelectItem.Invoke(c, new object[] { false }); } } } } } }