예제 #1
0
    public static VideoFile CreateVideoPanel(string movFile, GameObject parent)
    {
        GameObject objVideo = Instantiate(prefabVideo, parent.transform);

        if (!string.IsNullOrEmpty(movFile))
        {
            objVideo.name = movFile;
        }

        if (objVideo != null)
        {
            objVideo.SetActive(true);
        }
        else
        {
            Debug.LogError("");
        }

        parent.SetActive(true);

        VideoFile theVideo = objVideo.GetComponentInChildren <VideoFile>();

        theVideo.InitSource(); // asume before play

        GameObject        objController = Instantiate(prefabControl, parent.transform);
        UIVideoController ctrl          = objController.GetComponent <UIVideoController>();

        ctrl.InitPlayer(theVideo);

        videoList.Add(theVideo);

        return(theVideo);
    }