Exemplo n.º 1
0
    public void PlayVideo()
    {
        //生成视频对象
        GameObject    videoWindowPrefab = Resources.Load <GameObject>("Prefabs/VideoWindow");
        GameObject    videoWindowGo     = Instantiate(videoWindowPrefab, toPanel.transform);
        RectTransform rectTransform     = videoWindowGo.transform.GetChild(0).GetComponent <RectTransform>();

        rectTransform.anchoredPosition = new Vector2(0, 0);

        RectTransform rectbutton = videoWindowGo.transform.GetChild(0).GetChild(1).GetComponent <RectTransform>();

        rectbutton.anchoredPosition = new Vector2(290, 0);

        rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 200);
        rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 400);
        //播放视频
        videoWindowGo.transform.GetChild(0).GetChild(0).GetComponent <PlayVideo>().PrepareVideo(
            ReadDataUtil.ReadMovePath("企业视频/1"));

        videoWindowGo.transform.GetChild(0).GetChild(0).GetComponent <PlayVideo>().SetVideoLoop(true);
    }
Exemplo n.º 2
0
 public string FindVideoPath()
 {
     //Debug.Log(ReadDataUtil.ReadMovePath(videoName));
     return(ReadDataUtil.ReadMovePath(videoName));
 }