static public int get_audioTrackCount(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.Video.VideoClip self = (UnityEngine.Video.VideoClip)checkSelf(l); pushValue(l, true); pushValue(l, self.audioTrackCount); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
static public int constructor(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.Video.VideoClip o; o = new UnityEngine.Video.VideoClip(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public void Play(UnityEngine.Video.VideoClip videoClip) { // videoPlayer.Stop(); RenderTexture.active = videoPlayer.targetTexture; GL.Clear(false, true, new Color(0.0f, 0.0f, 1.0f, 1.00f)); GL.Color(new Color(0.0f, 0.0f, 1.0f, 1.0f)); RenderTexture.active = null; videoPlayer.source = VideoSource.VideoClip; videoPlayer.clip = videoClip; videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource; Debug.Log("videoClip.audioTrackCount= " + videoClip.audioTrackCount); videoPlayer.EnableAudioTrack(0, true); videoPlayer.SetTargetAudioSource(0, audioSource); videoPlayer.prepareCompleted += (source) => { source.Play(); audioSource.Play(); }; videoPlayer.loopPointReached += (source) => { EventMgr.startEvent("关闭"); }; videoPlayer.Prepare(); }
static public int GetAudioSampleRate(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.Video.VideoClip self = (UnityEngine.Video.VideoClip)checkSelf(l); System.UInt16 a1; checkType(l, 2, out a1); var ret = self.GetAudioSampleRate(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public void PrepareForClip(UnityEngine.Video.VideoClip clip) { if (videoPlayer != null) { videoPlayer.source = VideoSource.VideoClip; videoPlayer.clip = clip; videoPlayer.Prepare(); } }
void DetermineClipSource(bool isURL){ if(isURL){ videoPlayer.source = UnityEngine.Video.VideoSource.Url; videoPlayer.url = LessonConstructor.gameplayURL; }else{ videoPlayer.source = UnityEngine.Video.VideoSource.VideoClip; videoClip = LessonConstructor.playVideo; videoPlayer.clip = videoClip; } }
public void PlayVideo(UnityEngine.Video.VideoClip vc) { var videoPlayer = this.gameObject.GetComponent <UnityEngine.Video.VideoPlayer>(); videoPlayer.Prepare(); videoPlayer.clip = vc; // videoPlayer.loopPointReached += EndReached; videoPlayer.skipOnDrop = true; videoPlayer.isLooping = true; videoPlayer.Play(); }
static public int get_frameCount(IntPtr l) { try { UnityEngine.Video.VideoClip self = (UnityEngine.Video.VideoClip)checkSelf(l); pushValue(l, true); pushValue(l, self.frameCount); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int get_pixelAspectRatioDenominator(IntPtr l) { try { UnityEngine.Video.VideoClip self = (UnityEngine.Video.VideoClip)checkSelf(l); pushValue(l, true); pushValue(l, self.pixelAspectRatioDenominator); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { UnityEngine.Video.VideoClip o; o = new UnityEngine.Video.VideoClip(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
public void playVideo(UnityEngine.Video.VideoClip clip) { GetComponent <UnityEngine.Video.VideoPlayer>().clip = clip; GetComponent <UnityEngine.Video.VideoPlayer>().frame = 0; if (clip == mother) { GetComponent <UnityEngine.Video.VideoPlayer>().playbackSpeed = 1.1f; } else { GetComponent <UnityEngine.Video.VideoPlayer>().playbackSpeed = 0.7f; } GetComponent <UnityEngine.Video.VideoPlayer>().Play(); }
static public int GetAudioLanguage(IntPtr l) { try { UnityEngine.Video.VideoClip self = (UnityEngine.Video.VideoClip)checkSelf(l); System.UInt16 a1; checkType(l, 2, out a1); var ret = self.GetAudioLanguage(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
public override void start() { GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { objLayer.SetActive(true); VideoFile theVideo = VideoMgr.CreateVideoPanel(movFile, objLayer); UnityEngine.Video.VideoClip clip = AssetLoader.Load <UnityEngine.Video.VideoClip>(movFile); theVideo.Play(clip); } this.isEnd = true; }
/// <summary> VideoPlayer 切换“VideoClip”后,第一次进行播放 </summary> public virtual void VideoPlayStart(UnityEngine.Video.VideoPlayer videoPlayer, UnityEngine.Video.VideoClip videoClip) { JudgeVideoPlayer(videoPlayer); videoPlayer.clip = videoClip; videoPlayer.Play(); //动态切换 VideoClip 后,VideoPlayer 容易丢失 AudioSource,此举是动态赋予 AudioSource if (videoPlayer.GetComponent <AudioSource>() == null) { videoPlayer.gameObject.AddComponent <AudioSource>(); } videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource; videoPlayer.SetTargetAudioSource(0, videoPlayer.GetComponent <AudioSource>()); }
private static extern uint INTERNAL_CALL_GetAudioSampleRate(VideoClip self, ushort audioTrackIdx);
private static extern ushort INTERNAL_CALL_GetAudioChannelCount(VideoClip self, ushort audioTrackIdx);
/// <summary> /// Verifica se o jogador já está pronto para ir para o próximo nível ou se voltará para o nível anterior /// </summary> /// <param name="seconds"></param> /// <param name="NextLevel"></param> /// <param name="PreviousLevel"></param> /// <returns></returns> public IEnumerator CheckScore(float seconds, string NextLevel, string PreviousLevel) { GameObject resultado; yield return(new WaitForSeconds(seconds + 0.2f)); stageManager = StageManager.instance; //Pega a atual instância do Stage Manager DataManager.SelectProperFile(); // Salva as estatísticas atuais do jogador DataManager.SaveStatistics(); bool playConclusionVideo = false; //Se o resultado estiver correto if (getScorePositive() == maxScore) { if (stageManager.currentPlanet == 4 && !SaveManager.player.CompletouPlaneta(4)) { firstTimeBeatingRev1 = true; } GiveMoney(); GiveStars(); ResetTimePlaying(); resultado = Resources.Load("Prefabs/Feedback/Level Clear Message") as GameObject; resultado = Instantiate(resultado, GameObject.Find("Canvas").transform); // Se for o último ato do planeta, libera o próximo planeta. if (stageManager.currentAct == 3) { SaveManager.player.planeta[stageManager.currentPlanet].liberado = true; } // Caso seja a revisão verifica se é do sistema 0 if (stageManager.eRevisao) { // Se for do sistema 0, libera todos os outros if (!SaveManager.player.sistemaLiberado) { SaveManager.player.sistemaLiberado = true; } // Se não for o 0, verifica se concluiu todos os sistemas pela primeira vez else if (SaveManager.player.CompletouTodosSistemas() && !SaveManager.player.jaConcluiuJogo) { SaveManager.player.jaConcluiuJogo = true; playConclusionVideo = true; } } //// Se ganhar uma fase de revisão e for o último ato (caso tenha mais que um), libera o próximo sistema //if (stageManager.NextLevel.Contains("stageSelect") && stageManager.eRevisao) //{ // // Pega o inteiro no final do stageSelect (indica qual sistema está) e libera o proximo sistema (+1) // SaveManager.player.sistemaLiberado[System.Int32.Parse(stageManager.NextLevel.Substring(stageManager.NextLevel.Length - 1)) + 1] = true; //} SaveManager.Save(); yield return(new WaitForSeconds(2)); GameObject feedbackEstrelas; if (stars == 1) { feedbackEstrelas = Resources.Load("Prefabs/Feedback/GanhaUmaEstrela") as GameObject; Instantiate(feedbackEstrelas, GameObject.Find("Canvas").transform); yield return(new WaitForSeconds(1)); } else if (stars == 2) { feedbackEstrelas = Resources.Load("Prefabs/Feedback/GanhaDuasEstrela") as GameObject; Instantiate(feedbackEstrelas, GameObject.Find("Canvas").transform); yield return(new WaitForSeconds(2)); } else if (stars == 3) { feedbackEstrelas = Resources.Load("Prefabs/Feedback/GanhaTresEstrela") as GameObject; Instantiate(feedbackEstrelas, GameObject.Find("Canvas").transform); yield return(new WaitForSeconds(2)); } if (playConclusionVideo) { UnityEngine.Video.VideoClip videoClip = Resources.Load <UnityEngine.Video.VideoClip>(conclusionVideoName); GameObject loadScene = new GameObject(); loadScene.AddComponent <LoadScene>(); loadScene.GetComponent <LoadScene>().LoadSceneWithFade(videoClip, NextLevel); } else { if (firstTimeBeatingRev1) { UnityEngine.Video.VideoClip videoClip = Resources.Load(caminhoVideoSystem) as UnityEngine.Video.VideoClip; stageManager.video = videoClip; firstTimeBeatingRev1 = false; StartCoroutine(stageManager.CallAnotherLevel(3, "06_systemSelect", true)); } else { UnityEngine.Video.VideoClip videoClip = Resources.Load <UnityEngine.Video.VideoClip>(conclusionVideoName); StartCoroutine(stageManager.CallAnotherLevel(3, NextLevel, true));//espera o dobro do tempo pois esta funcao é chamada ao mesmo tempo que a da linha de cima } } } //Caso o resultado esteja errado else if (getScoreNegative() == maxScore) { resultado = Resources.Load("Prefabs/Feedback/Level Failed Message") as GameObject; resultado = Instantiate(resultado, GameObject.Find("Canvas").transform); SaveManager.Save(); yield return(new WaitForSeconds(4)); StartCoroutine(stageManager.CallAnotherLevel(3, PreviousLevel, false));//espera o dobro do tempo pois esta funcao é chamada ao mesmo tempo que a da linha de cima } else { // Limpa os TextSlots para a proxima palavra for (int i = 0; i < LevelController.textSlots; i++) { LevelController.inputText[i] = "";//reset var after confirm button is clicked } SetaIndicadora.DestroiSeta(); StartCoroutine(silabaControl.CallSilaba(0));//chama nova sílaba } }
public uint GetAudioSampleRate(ushort audioTrackIdx) { return(VideoClip.INTERNAL_CALL_GetAudioSampleRate(this, audioTrackIdx)); }
public ushort GetAudioChannelCount(ushort audioTrackIdx) { return(VideoClip.INTERNAL_CALL_GetAudioChannelCount(this, audioTrackIdx)); }