Exemplo n.º 1
0
        public static void KillStoryNode(GameObject rootGo)
        {
            if (rootGo == null)
            {
                return;
            }
            var root = rootGo.GetComponent <StoryData>();

            if (root == null)
            {
                return;
            }
            if (root.flowchart == null)
            {
                root.flowchart = rootGo.GetComponentInChildren <Fungus.Flowchart>(true);
            }
            root.flowchart.StopAllBlocks();
            var video = rootGo.GetComponentInChildren <DisplayUGUI>(true);

            if (video != null)
            {
                VideoManager.GetInstance().Clean();
                Fungus.MediaPlay.IsFinishPlaying = false;
            }
            FinishStory(root);
            ResetStoryRoot(rootGo);
            root.flowchart.gameObject.SetActive(false);
            rootGo.SetActive(false);
        }
Exemplo n.º 2
0
        private void callback(string html)
        {
            if (html.Contains("识别码搜寻结果"))
            {
                //<div class="video" id="vid_javlio354y"><a href="./?v=javlio354y" title="ABP-001 水咲ローラがご奉仕しちゃう超最新やみつきエステ"><div class="id">ABP-001</div>
                //http://www.javlibrary.com/cn/?v=javlio354y
                Regex regVideo  = new Regex("<div class=\"video\".*" + video.Code + "</div>");
                var   videoItem = regVideo.Match(html);
                if (!string.IsNullOrEmpty(videoItem.Value))
                {
                    // 这是从javlibrary上搜到了不止一个影片信息,那就取第一个信息
                    var m = new Regex("<a href=.* title=").Match(videoItem.Value);
                    var t = m.Value.Replace("\"", "").Replace("<a href=./", "").Replace(" title=", "");
                    HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javlibrary.com/cn/{0}", t), this.callback);
                }
                else
                {
                    //javlibrary找不到影片信息上找不到,那就到javmoo上去找
                    //HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javmoo.xyz/cn/search/{0}", video.Code), this.callbackOnJav);
                    //MessageBox.Show("找不到相关信息");

                    //javlibrary找不到影片信息上找不到,那就到javbus上去找
                    HTMLHelper.GetInstance().GetHtml(string.Format("https://www.javbus.me/{0}", video.Code), this.callbackOnJav);
                }
            }
            else
            {
                // 从javlibrary上找到了信息
                VideoManager.GetInstance().CreateVideo(html, Video.Code, Video);
                this.onCreateVideo();
            }
        }
Exemplo n.º 3
0
        public override void OnEnter()
        {
            var videoMan = VideoManager.GetInstance();

            videoMan.Skip();
            Continue();
        }
Exemplo n.º 4
0
        public static void JumpToEnd(GameObject rootGo)
        {
            StopStoryNode(rootGo);

            var pdCtrl = rootGo.GetComponentInChildren <PlayableDirectorManualCtrl>();

            if (pdCtrl != null)
            {
                pdCtrl.Pause();
            }
            var pd = rootGo.GetComponentInChildren <PlayableDirector>();

            if (pd != null)
            {
                pd.time = pd.duration - 0.01f;
                pd.Evaluate();
            }

            var video = rootGo.GetComponentInChildren <DisplayUGUI>();

            if (video != null)
            {
                VideoManager.GetInstance().Pause();
            }
        }
Exemplo n.º 5
0
        IEnumerator DoWait()
        {
            while (Fungus.MediaPlay.IsFinishPlaying == false)
            {
                yield return(null);
            }


            CamMaskUtilities.SetMaskColor(1, 100);
            var storyData = gameObject.GetComponentInParent <StorySystem.StoryData>();

            if (storyData != null)
            {
                storyData.OnFlowEnd("剧情结束");
            }
            var videoMan = VideoManager.GetInstance();

            videoMan.VideoComp.Clean();

            Fungus.MediaPlay.IsFinishPlaying = false;
            var flow = GetFlowchart();

            flow.StopAllBlocks();
            LJAudio.AudioManager.StopAllSound();
        }
Exemplo n.º 6
0
        public override void OnEnter()
        {
            // if ("高端机") 宽和高 > 1090x1080 或者主频大于2000
            if ((Screen.width > 1920 || Screen.height > 1080) || SystemInfo.processorFrequency > 2000)
            {
                //是高端机
            }
            else
            {
                filename = filename.Replace("StoryVideo", "StoryVideo_Low");
            }

            IsFinishPlaying = false;
            var videoMan = VideoManager.GetInstance();

            Logger.Log("屏幕宽高 -主频 -filename  " + Screen.width + " x " + Screen.height + " " + SystemInfo.processorFrequency + " " + filename);

            videoMan.PlayVideo(filename, false, () =>
            {
                if (NeedChangeSceneAnim)
                {
                    Texture2D Maintex = CaptureCamera(StorySystem.StoryDataUtilities.FindUICam().GetComponent <Camera>(), new Rect(0, 0, Screen.width, Screen.height));
                    StorySystem.StoryDataUtilities.ChangeBattleSceneAnim(Maintex);
                }
                IsFinishPlaying = true;
            });

            Continue();
        }
Exemplo n.º 7
0
    public void DoContiue()
    {
        var videoMan = VideoManager.GetInstance();

        videoMan.Contiue();
        btn3.gameObject.SetActive(false);
        btn2.gameObject.SetActive(true);
    }
Exemplo n.º 8
0
    public void DoPlay()
    {
        var videoMan = VideoManager.GetInstance();

        videoMan.PlayVideo(fileName3, true, null);
        // btn1.gameObject.SetActive(false);
        // btn4.gameObject.SetActive(true);
    }
Exemplo n.º 9
0
        public override void OnEnter()
        {
            var videoMan = VideoManager.GetInstance();

            videoMan.SetPlaybackRate(speed);
            videoMan.Contiue();
            Continue();
        }
Exemplo n.º 10
0
        public override void OnEnter()
        {
            var videoMan = VideoManager.GetInstance();

            videoMan.Skip();
            videoMan.PlayVideo(filename, false, null);
            Continue();
        }
Exemplo n.º 11
0
        public override void OnEnter()
        {
            var videoMan = VideoManager.GetInstance();

            stopBlock = true;
            MediaComeTo.StartBlock = false;
            MediaComeTo.update     = false;
            videoMan.VideoComp.Skip();
            Continue();
        }
Exemplo n.º 12
0
        //[XLua.CSharpCallLua]
        //public delegate void FinAction( string param );
        public static void PlayStoryNode(GameObject rootGo, System.Action <string> onFin, string name = null, System.Action <string> ReceiveScene = null)
        {
            ConfigCanvas(rootGo);
            if (rootGo == null)
            {
                return;
            }
            if (!rootGo.activeSelf)
            {
                rootGo.SetActive(true);
            }
            if (StoryExtendCanvas)
            {
                var thisCanvas = StoryExtendCanvas;

                if (thisCanvas.transform.Find("video_StoryRoot(Clone)"))
                {
                    GameObject video_StoryRoot = thisCanvas.transform.Find("video_StoryRoot(Clone)").gameObject;
                    //if (video_StoryRoot.activeSelf == false)
                    //    video_StoryRoot.SetActive(true);
                    VideoManager.GetInstance().SetupTarget(video_StoryRoot);
                }
            }


            var root = rootGo.GetComponent <StoryData>();

            if (root == null)
            {
                if (onFin != null)
                {
                    onFin("");
                }
                return;
            }

            root.onStoryEnd += onFin;
            root.flowchart.StopAllBlocks();
            root.flowchart.Reset(true, true);
            if (root.flowchart.gameObject.activeInHierarchy)
            {
                root.flowchart.gameObject.SetActive(false);
            }
            root.flowchart.gameObject.SetActive(true);


            if (name != null)
            {
                StoryUserName = name;
            }


            func += ReceiveScene;
        }
Exemplo n.º 13
0
        public void InitVideoInfo()
        {
            videoManager = VideoManager.GetInstance();
            FilterVideo();

            this.classTypeComboBox.Items.Add("所有");
            foreach (var item in ClassTypeManager.GetInstance().GetClassType())
            {
                this.classTypeComboBox.Items.Add(item);
            }
        }
Exemplo n.º 14
0
 private void callbackOnJav(string html)
 {
     if (html.Contains("404 Page Not Found"))
     {
         MessageBox.Show("没有搜寻结果");
     }
     else
     {
         VideoManager.GetInstance().CreateVideoFromJav(html, Video.Code, Video);
         this.onCreateVideo();
     }
 }
Exemplo n.º 15
0
        IEnumerator DoWait()
        {
            while (Fungus.MediaPlay.IsFinishPlaying == false)
            {
                yield return(null);
            }

            var videoMan = VideoManager.GetInstance();

            videoMan.VideoComp.Clean();
            Fungus.MediaPlay.IsFinishPlaying = false;
            Continue();
        }
Exemplo n.º 16
0
    public void DoSkip()
    {
        var videoMan = VideoManager.GetInstance();

        videoMan.Skip();
        btn4.gameObject.SetActive(false);
        btn1.gameObject.SetActive(true);
        btn2.gameObject.SetActive(true);
        btn3.gameObject.SetActive(false);

        videoMan = VideoManager.GetInstance();
        videoMan.PlayVideo(fileName2, false, null);
    }
Exemplo n.º 17
0
 private void OnAddHandler(object sender, RoutedEventArgs e)
 {
     if (CurrentVideo != null)
     {
         VideoManager.GetInstance().AddVideo(CurrentVideo);
         ImageHelper.DoGetImage(CurrentVideo.ImgUrl, string.Format("{0}{1}\\{2}", CurrentVideo.Path, CurrentVideo.Code, CurrentVideo.Code + "l.jpg"));
         ImageHelper.DoGetImage(CurrentVideo.SubImgUrl, string.Format("{0}{1}\\{2}", CurrentVideo.Path, CurrentVideo.Code, CurrentVideo.Code + "s.jpg"));
         MessageBox.Show("保存成功");
     }
     else
     {
         MessageBox.Show("没有可以添加的影片信息");
     }
 }
Exemplo n.º 18
0
 public override void OnEnter()
 {
     videoMan = VideoManager.GetInstance();
     time     = videoMan.VideoComp.GetCurrentTimeMs();
     if (MediaComeToStop.stopBlock)
     {
         update = false;
         Continue();
     }
     else
     {
         update     = true;
         StartBlock = true;
     }
 }
Exemplo n.º 19
0
        public static void StopStoryNode(GameObject rootGo)
        {
            if (rootGo == null)
            {
                return;
            }
            var root = rootGo.GetComponent <StoryData>();

            if (root == null)
            {
                return;
            }
            if (root.flowchart == null)
            {
                root.flowchart = rootGo.GetComponentInChildren <Fungus.Flowchart>();
            }
            root.flowchart.StopAllBlocks();
            var canvas = root.GetComponentsInChildren <Canvas>();

            foreach (var can in canvas)
            {
                if (!can.isRootCanvas)
                {
                    continue;
                }
                if (!can.name.Equals("Canvas"))
                {
                    continue;
                }
                can.gameObject.SetActive(false);
            }
            var video = rootGo.GetComponentInChildren <DisplayUGUI>();

            if (video != null)
            {
                VideoManager.GetInstance().Pause();
            }
            LJAudio.AudioManager.StopAllSound();
        }
Exemplo n.º 20
0
        private void callback(string html)
        {
            if (html.Contains("识别码搜寻结果"))
            {
                //<div class="video" id="vid_javlio354y"><a href="./?v=javlio354y" title="ABP-001 水咲ローラがご奉仕しちゃう超最新やみつきエステ"><div class="id">ABP-001</div>
                //http://www.javlibrary.com/cn/?v=javlio354y
                Regex regVideo  = new Regex("<div class=\"video\".*" + code + "</div>");
                var   videoItem = regVideo.Match(html);
                if (!string.IsNullOrEmpty(videoItem.Value))
                {
                    var m = new Regex("<a href=.* title=").Match(videoItem.Value);
                    var t = m.Value.Replace("\"", "").Replace("<a href=./", "").Replace(" title=", "");
                    HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javlibrary.com/cn/{0}", t), this.callback);
                }
                else
                {
                    MessageBox.Show("找不到影片信息:" + code);
                }
            }
            else
            {
                CurrentVideo = VideoManager.GetInstance().CreateVideo(html, code);

                if (RegularHelper.IsUrl(CurrentVideo.ImgUrl))
                {
                    this.coverImg.Dispatcher.Invoke(new Action(delegate { this.coverImg.Source = new BitmapImage(new Uri(CurrentVideo.ImgUrl)); }));
                }
                else
                {
                    Logger.Error(string.Format("{0}的封面地址有误:{1}", CurrentVideo.Code, CurrentVideo.ImgUrl));
                }

                this.nameTextBox.Dispatcher.Invoke(new Action(delegate { this.nameTextBox.Text = CurrentVideo.Name; }));
                this.birthdayTextBox.Dispatcher.Invoke(new Action(delegate { this.birthdayTextBox.Text = CurrentVideo.Date.ToString("yyyy-MM-dd"); }));
                this.classTypeTextBox.Dispatcher.Invoke(new Action(delegate { this.classTypeTextBox.Text = CurrentVideo.GetClassString(); }));
                this.actressTextBox.Dispatcher.Invoke(new Action(delegate { this.actressTextBox.Text = CurrentVideo.GetActressString(); }));
            }
        }
Exemplo n.º 21
0
 private void InitVideoManager()
 {
     Console.WriteLine("开始初始化Video");
     videoManager = VideoManager.GetInstance();
     videoManager.Init(InitInfo);
 }