Ejemplo n.º 1
0
        /// <summary>
        /// ExternalResources内や、直接指定での動画再生用のインスタンスを生成.
        /// ※ 頭出しなどを行う時はこの関数で生成したPlayerを使って頭出しを実装する.
        /// </summary>
        public static MovieElement CreateElement(string moviePath, Graphic targetGraphic, Player.ShaderDispatchCallback shaderOverrideCallBack = null)
        {
            if (!File.Exists(moviePath))
            {
                throw new FileNotFoundException(moviePath);
            }

            var movieController = UnityUtility.GetOrAddComponent <CriManaMovieControllerForUI>(targetGraphic.gameObject);

            movieController.target  = targetGraphic;
            movieController.enabled = true;

            UnityUtility.SetActive(movieController.gameObject, true);

            var moviePlayer = movieController.player;

            moviePlayer.SetFile(null, moviePath);

            if (shaderOverrideCallBack != null)
            {
                moviePlayer.SetShaderDispatchCallback(shaderOverrideCallBack);
            }

            var movieElement = new MovieElement(moviePlayer, movieController, moviePath);

            Instance.movieElements.Add(movieElement);

            return(movieElement);
        }
Ejemplo n.º 2
0
        public static void Stop(MovieElement element)
        {
            if (element == null || element.Player == null)
            {
                return;
            }

            element.Player.Stop();
        }
Ejemplo n.º 3
0
        public MovieElement Play(string moviePath, Graphic targetGraphic)
        {
            var movieController = UnityUtility.GetOrAddComponent <CriManaMovieControllerForUI>(targetGraphic.gameObject);

            movieController.target = targetGraphic;

            var manaPlayer = movieController.player;

            manaPlayer.SetFile(null, moviePath);
            manaPlayer.Start();

            var movieElement = new MovieElement(manaPlayer, moviePath);

            movieElements.Add(movieElement);

            return(movieElement);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// ExternalResources内や、直接指定での動画再生用のインスタンスを生成.
        /// ※ 頭出しなどを行う時はこの関数で生成したPlayerを使って頭出しを実装する.
        /// </summary>
        public static MovieElement CreateElement(string moviePath, Graphic targetGraphic, Player.ShaderDispatchCallback shaderOverrideCallBack = null)
        {
            var movieController = UnityUtility.GetOrAddComponent <CriManaMovieControllerForUI>(targetGraphic.gameObject);

            movieController.target = targetGraphic;

            var manaPlayer = movieController.player;

            manaPlayer.SetFile(null, moviePath);

            if (shaderOverrideCallBack != null)
            {
                manaPlayer.SetShaderDispatchCallback(shaderOverrideCallBack);
            }

            var movieElement = new MovieElement(manaPlayer, movieController, moviePath);

            Instance.movieElements.Add(movieElement);

            return(movieElement);
        }
Ejemplo n.º 5
0
 public void Stop(MovieElement element)
 {
     element.GetPlayer().Stop();
 }