private void StartMovie() { stateText.text = "ロード中です。"; button.interactable = false; // インスタンスの生成 if (logoVideo == null) { logoVideo = Art.Sample.VideoPlay.Create(mainCamera); } if (opVideo == null) { opVideo = Art.Sample.VideoPlay.Create(mainCamera); } // イベント設定 logoVideo.OnPrepareCompleted = PrepareCompleted; logoVideo.OnStarted = Started; logoVideo.OnEnd = PlayEnd; logoVideo.OnErrorReceived = ErrorReceived; opVideo.OnPrepareCompleted = PrepareCompleted; opVideo.OnStarted = Started; opVideo.OnEnd = PlayEnd; opVideo.OnErrorReceived = ErrorReceived; // 表示を有効にする logoVideo.SetEnabled(true); opVideo.SetEnabled(true); // 事前ロード logoVideo.Preload(Application.streamingAssetsPath + "/applibot_3sec.mp4"); opVideo.Preload(Application.streamingAssetsPath + "/applibot_eagle_movie.mp4"); }
/// <summary>インスタンスの生成</summary> public static VideoPlay Create(Camera camera = null) { // シーンを横断する場合はDontDestroyOnLoadにする GameObject movieGameObject = new GameObject(kMovieGameObjectName); VideoPlay movieBehaviour = movieGameObject.AddComponent <VideoPlay>(); movieBehaviour.Init(movieGameObject, camera); return(movieBehaviour); }