Esempio n. 1
0
	public IEnumerator PlayVideo()
	{
		GameObject.Find ("First Person Controller").GetComponent<Level10Health> ().guiEnabled = false;
		cam.depth = 2;
		GameObject.Find("Initialization").GetComponent<AudioSource>().audio.Stop();
		GameObject.Find("Initialization").GetComponent<CursorTime>().showCursor = false;
		GameObject.Find("Initialization").GetComponent<AudioSource>().volume = 1;
		Screen.lockCursor = true;
		//Screen.showCursor = false;
		//GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = false;
		//GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = false;
		movie = renderer.material.mainTexture as MovieTexture;
		audio.clip = movie.audioClip;
		audio.Play();
		movie.Play();
		yield return new WaitForSeconds(audio.clip.length);
		movie.Stop();
		cam.depth = -2;
		audio.volume = 0;
		movie.Play();
		audio.Play();
		yield return new WaitForSeconds(0.2F);
		movie.Pause();
		audio.Pause();
		Screen.lockCursor = false;
		GameObject.Find("Initialization").GetComponent<AudioSource>().audio.clip = scary;
		audio.volume = 1;
		GameObject.Find("Initialization").GetComponent<AudioSource>().audio.Play ();
		GameObject.Find("Initialization").GetComponent<CursorTime>().showCursor = true;
		GameObject.Find ("First Person Controller").GetComponent<Level10Health> ().guiEnabled = true;
		//Application.LoadLevel(Application.loadedLevel);
	}
Esempio n. 2
0
	IEnumerator PlayMovieWWW(string url) {
		WWW www = new WWW(url);
		while(!www.movie.isReadyToPlay)
			yield return www;
		try {          
			if (www.error != null)
				Debug.Log("WWW Error - " + www.error);
			else {
				movieTexture = www.movie;
				Debug.Log("Movie is playing!");
				movieAudioClip = movieTexture.audioClip;
				movieAudioSource.clip = movieAudioClip;
				mMovie.renderer.material.mainTexture = movieTexture;
				movieTexture.Play();
				movieAudioSource.Play();
			}
		}
		catch(Exception ex){
			Debug.Log("EarthRotator.DownloadFile(): Exception - " + ex.Message);
			Exception innerEx = ex.InnerException;
			while (innerEx != null) {
				Debug.Log("EarthRotator.DownloadFile(): Inner Exception - " + innerEx.Message);
				innerEx = innerEx.InnerException;
			}
	    }
	}
 // Use this for initialization
 void Start()
 {
     movie = GetComponent<Renderer>().material.mainTexture as MovieTexture;
     GetComponent<AudioSource>().clip = movie.audioClip;
     GetComponent<AudioSource>().Play();
     movie.Play();
 }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     mtex = GetComponent<Renderer>().material.mainTexture as MovieTexture;
     #if (!UNITY_EDITOR)
         mtex.Play();
     #endif
 }
Esempio n. 5
0
    protected IEnumerator StartStream()
    {
        //KEEP IT HERE
        string sexVideo = "file://" + Application.streamingAssetsPath + "/Sex1.ogv";
        string platonicVideo = "file://" + Application.streamingAssetsPath + "/Prude1.ogv";
        string url;

        if (isSexVideoPlaying)
        {
            url = sexVideo;
        }
        else
        {
            url = platonicVideo;
        }

        WWW videoStreamer = new WWW(url);

        movieTexture = videoStreamer.movie;
        GetComponent<AudioSource>().clip = movieTexture.audioClip;
        while (!movieTexture.isReadyToPlay)
        {
            yield return 0;
        }

        GetComponent<AudioSource>().Play ();
        movieTexture.Play ();
        movieTexture.loop = true;
        GetComponent<RawImage>().texture = movieTexture;
        //GetComponent<Renderer>().material.mainTexture = movieTexture;
    }
Esempio n. 6
0
 public void playTreasureAnimation()
 {
     //show movie
     this.enabled = true;
     movie = this.GetComponent<RawImage>().mainTexture as MovieTexture;
     movie.Play();
 }
Esempio n. 7
0
 void Awake()
 {
     myRenderer = GetComponent<Renderer>();
     myMovieTexture = (MovieTexture)myRenderer.material.mainTexture;
     myMovieTexture.loop = IsMovieLoopable;
     myMovieTexture.Play ();
 }
    IEnumerator DoSetVideo(MovieTexture texture)
    {
        //We need the video to play before we can get his size
        while (!texture.isPlaying)
        {
            texture.Play();
            yield return null;
        }
        texture.Stop();

        movie = texture;
        movie.loop = true;
        var videoObject = GetComponentInChildren<VideoObject>();
        videoObject.SetVideo(texture);

        playButton = GetComponentInChildren<Image>();

        var collider = GetComponent<BoxCollider2D>();
        var ratioX = (float)texture.width / texture.height;
        var ratioY = (float)texture.height / texture.width;
        if (ratioX > 1)
        {
            var size = new Vector2(RectTransform.sizeDelta.x * ratioX, RectTransform.sizeDelta.y);
            RectTransform.sizeDelta = size;
            collider.size = size;
        }
        else
        {
            var size = new Vector2(RectTransform.sizeDelta.x, RectTransform.sizeDelta.y * ratioY);
            RectTransform.sizeDelta = size;
            collider.size = size;
        }
    }
Esempio n. 9
0
    void Start()
    {
        r = GetComponent<Renderer>();
         movie = (MovieTexture)r.material.mainTexture;

         movie.Play();
    }
Esempio n. 10
0
	// Use this for initialization
	void Start () {
		resize_window_plane ();
		mov = (MovieTexture)renderer.material.mainTexture;
		mov.Play ();
		audio.Play();
		StartCoroutine(checkMovieEnds());
	}
Esempio n. 11
0
    // Use this for initialization
    void Start()
    {
        transform.localScale = new Vector3(Camera.main.orthographicSize/2 * (Screen.width/Screen.height),Camera.main.orthographicSize/2,1f);

        audioSource = GetComponent<AudioSource> ();

        if (HammerController.gameOverState == 1) {
            //success
            GetComponent<MeshRenderer> ().materials [0].mainTexture = textures [0];
            movTerxture = (MovieTexture)GetComponent<MeshRenderer> ().materials [0].mainTexture;
            movTerxture.Play();
            audioSource.clip = music1;
            audioSource.Play();
            audioSource.PlayOneShot(voiceovers[0]);

        }
        else if(HammerController.gameOverState == 2 )
        {
            GetComponent<MeshRenderer> ().materials [0].mainTexture = textures [1];
            movTerxture = (MovieTexture)GetComponent<MeshRenderer> ().materials [0].mainTexture;
            movTerxture.Play();
            audioSource.clip = music2;
            audioSource.Play();
            audioSource.PlayOneShot(voiceovers[1]);

        }
    }
    IEnumerator LoadMovie(string url)
    {
        debugText.text += "\nLoading...";

        WWW videoStream = new WWW (url);
        sphereTexture = videoStream.movie;
        GetComponent <AudioSource>().clip = videoStream.audioClip;

        float startLoadTime = Time.timeSinceLevelLoad;

        while (!sphereTexture.isReadyToPlay)
        {
            if (!string.IsNullOrEmpty(videoStream.error))
            {
                debugText.text += videoStream.error;
                return false;
            }
            yield return 0;
        }
        debugText.text += "\nTime " + (Time.timeSinceLevelLoad - startLoadTime).ToString ();
        debugText.text += "\nReady!";

        GetComponent<Renderer> ().material.mainTexture = sphereTexture;
        GetComponent<AudioSource> ().Play ();
        sphereTexture.Play ();
        sphereTexture.loop = true;
    }
Esempio n. 13
0
 void Start() {
     movie = (MovieTexture) GetComponent<Renderer>().material.mainTexture;
     movie.loop = true;
     movie.Play();
     //CameraFade.StartAlphaFade(
     //    new Color(0,0,0),true,2f,0f);
     StartCoroutine(StartGame(12f));
 }
Esempio n. 14
0
    // Use this for initialization
    void Start()
    {
        mov = ((MovieTexture) GetComponent<Renderer>().material.mainTexture);
        mov.loop = true;
        mov.Play();

        EventManager.AddListener((int) GameManagerScript.GameEvents.Paused, OnPaused);
    }
Esempio n. 15
0
 // Use this for initialization
 void Start()
 {
     text = ((MovieTexture)GetComponent<Renderer>().material.mainTexture);
     aud = GetComponent<AudioSource>();
     aud.clip = text.audioClip;
     text.Play();
     aud.Play();
 }
Esempio n. 16
0
    // Use this for initialization
    void Start()
    {
        //movTerxture = (MovieTexture)GetComponent<Renderer>().material.mainTexture;
        RawImage rim = GetComponent<RawImage>();
        movTerxture = (MovieTexture)rim.mainTexture;

        movTerxture.Play();
    }
Esempio n. 17
0
 public void playVideo(MovieTexture texture)
 {
     this.movie = texture;
     this.gameObject.SetActive(true);
     GetComponent<RawImage>().texture = movie as MovieTexture;
     movie.Stop();
     movie.Play();
 }
Esempio n. 18
0
	// Use this for initialization
	void Start () {
        _video = ((MovieTexture)GetComponent<Renderer>().material.mainTexture);
        _video.Play();
        if (Button.FindObjectOfType<Button>())
            _buttonBegin = Button.FindObjectOfType<Button>();
        else
            _buttonBegin = null;
	}
Esempio n. 19
0
 void OnGUI()
 {
     if(m!=null)
         GUI.DrawTexture (new Rect (0,0,Screen.width,Screen.height),m,ScaleMode.StretchToFill);
     else
         GUI.Label(new Rect(50,100,200,50), "Video is yet to Start");
     if(isMenu) {
         GUI.Box(new Rect(20, Screen.height - 60, Screen.width-40,60),"");
         for ( int i=0;i < mediaSource.Length;i++) {
             if(m!=null)
                 if (i == tmp && m.isPlaying)
                     playButtonString="pause"; //it's playing so the button should pause.
             else
                 playButtonString="play"; //it's not playing and the button should play the movie.
             if (GUI.Button (new Rect (30 + (200 * i),Screen.height-40,100,30),playButtonString + i) == true)
             {
                 if(m!=null)
                 if (m.isPlaying == true) {
                     m.Pause();
                     AS.Pause();
                     if (i == tmp)
                         return;
                 }
                 else if(m.isReadyToPlay && i == tmp)
                 {
                     m.Play();
                     AS.Play();
                     return;
                 }
                 www = new WWW(url+mediaSource[i]);
                 m = www.movie;
                 AS.clip = m.audioClip;
                 while(!m.isReadyToPlay) {
                     SomeCoroutine();
                     if (!m.isPlaying) {
                         m.Play();
                         if(!AS.isPlaying)
                             AS.Play();
                     }
                 }
                 Screen.fullScreen = true;
                 isMenu = false;
                 tmp = i;
             }
             if (GUI.Button (new Rect(130 + (200 *i),Screen.height-40,100,30),"Stop"+ i)==true && i==tmp) {
                 m.Stop();
                 AS.Stop();
             }
         }
     }
     else {
         GUI.Label( new Rect(Screen.width - 200, 10,200,20), "Press Esc for Menu or");
         if(GUI.Button( new Rect(Screen.width - 200, 30,100,20), "Click Here")) {
             isMenu = true;
             Screen.fullScreen = false;
         }
     }
 }
    void startIntroVideo()
    {
        Destroy (titlePage.gameObject);

        RawImage rim = videoPlayer.GetComponent<RawImage>();
        movTexture = (MovieTexture)rim.mainTexture;
        movTexture.Play();
        audioSource.PlayOneShot (introAudio);
    }
Esempio n. 21
0
 public void PlayMovie(MovieTexture m)
 {
     this.movie = m;
     renderer.material.mainTexture = movie as MovieTexture;
     movie.loop = false;
     movie.Stop ();
     //audio.Play ();
     movie.Play();
 }
    // Use this for initialization
    void Start()
    {
        Renderer r = GetComponent<Renderer>();
        movie = (MovieTexture)r.material.mainTexture;

        //GUI.DrawTexture(Rect(0,0,1920,1080),movie,ScaleMode.StretchToFill);

        movie.Play();
    }
Esempio n. 23
0
    // Update is called once per frame
    void Update()
    {
        if (mt.isPlaying)
        {
            timeElapsed += Time.deltaTime;
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (mt.isPlaying)
            {
                mt.Pause();
            }
            else
            {
                mt.Play();
            }
        }
    }
Esempio n. 24
0
		public override void OnEnter()
		{
			MovieTexture movieTexture = this.movieTexture.Value as MovieTexture;
			if (movieTexture != null)
			{
				movieTexture.loop = this.loop.Value;
				movieTexture.Play();
			}
			base.Finish();
		}
Esempio n. 25
0
    void Start()
    {
        movTexture = Resources.Load ("LMixLogo2") as MovieTexture;
        GetComponent<Renderer> ().material.mainTexture = movTexture;

        movTexture.loop = true;
        if (!movTexture.isPlaying) {
            movTexture.Play ();
        }
    }
Esempio n. 26
0
 public override void Check(float currentTime)
 {
     if (currentTime.Equals(this.StartTime + (this.Duration * this.TimesRepeated)))
     {
         Debug.Log("PAR clip stopped");
         Debug.Log(this.Duration * this.TimesRepeated);
         movieComponent.Play();
         targetObject.GetComponent <MeshRenderer>().enabled = false;
     }
 }
Esempio n. 27
0
 /// <summary>
 /// Initialization
 /// </summary>
 public override void Start()
 {
     base.Start();
     if (m_autoPlay && m_backgroundTexture && (m_backgroundTexture.GetType() == typeof(MovieTexture)))
     {
         MovieTexture m_bacgkroundMovieTexture = m_backgroundTexture as MovieTexture;
         m_bacgkroundMovieTexture.Play();
         m_bacgkroundMovieTexture.loop = m_loop;
     }
 }
Esempio n. 28
0
    private void StartPlaying()
    {
        //Debug.Log("Starting play for " + this.name);

        myRenderer.material = movieMaterial;
        movieTexture.Play();
        myAudioSource.Play();

        shouldBePlaying = true;
    }
Esempio n. 29
0
 // Use this for initialization
 void Start()
 {
     //gogo = new myGoGolib();
     //gogo.setupComm(myGoGolib.typeCommu.useSerial, "COM3");
     GetComponent <RawImage> ().texture = movTexture as MovieTexture;
     audios      = GetComponent <AudioSource>();
     audios.clip = movTexture.audioClip;
     movTexture.Play();
     audios.Play();
 }
        public void Play()
        {
            if (IsReadyToPlay)
            {
                m_movieTexture.Play();
                m_audioSource.Play();

                m_status = StreamingVideoStatus.Playing;
            }
        }
Esempio n. 31
0
    void Start()
    {
        MovieTexture video360_1 = (MovieTexture)Sphere1.GetComponent <Renderer>().material.mainTexture;
        MovieTexture video360_2 = (MovieTexture)Sphere2.GetComponent <Renderer>().material.mainTexture;

        video360_1.loop = true;
        video360_2.loop = true;
        video360_1.Play();
        video360_2.Play();
    }
Esempio n. 32
0
 private void playMovie(MovieTexture movie)
 {
     GetComponent <RawImage>().texture = movie as MovieTexture;
     movieAudio = GetComponent <AudioSource>();
     //movieAudioClip = movie.audioClip;
     movie.Stop();
     movie.Play();
     movieAudio.clip = movie.audioClip;
     movieAudio.Play();
 }
Esempio n. 33
0
    IEnumerator LoadDemo()
    {
        yield return(new WaitForSeconds(secondsUntilDemoPlays));

        movieRenderer.gameObject.SetActive(true);
        MovieTexture movie = (MovieTexture)movieRenderer.material.mainTexture;

        movie.Play();
        movie.loop = true;
    }
Esempio n. 34
0
    void Start()
    {
        GetComponent <RawImage> ().texture = movie as MovieTexture;
        audio      = GetComponent <AudioSource> ();
        audio.clip = movie.audioClip;

        movie.Play();
        audio.Play();
        movie.loop = true;
    }
Esempio n. 35
0
 public void PlayCutscene1()
 {
     thisimage.texture = movie1 as MovieTexture;
     sound.clip        = cutscene1;
     movie1.Play();
     sound.Play();
     timer    = 0;
     duration = movie1.duration;
     playing  = true;
 }
Esempio n. 36
0
 // Use this for initialization
 void Start()
 {
     r = GetComponent <Renderer>();
     r.material.mainTexture = movie as MovieTexture;
     audio      = GetComponent <AudioSource>();
     audio.clip = movie.audioClip;
     movie.Play();
     audio.Play();
     Debug.Log("go video");
 }
Esempio n. 37
0
 void Start()
 {
     movie = GetComponent<RawImage>().texture as MovieTexture;
     audio = GetComponent<AudioSource>();
     audio.clip = movie.audioClip;
     Screen.fullScreen = true;
     movie.Play();
     audio.Play();
     StartCoroutine("waitForMovieEnd");
 }
Esempio n. 38
0
    void Start()
    {
        Material     mat     = renderer.material;
        Texture      texture = mat.mainTexture;
        MovieTexture movie   = texture as MovieTexture;

        movie.Stop();
        movie.loop = true;
        movie.Play();
    }
	// Use this for initialization
	void Start () {
		movie = GetComponent<Renderer>().material.mainTexture as MovieTexture;
		GetComponent<AudioSource>().clip = movie.audioClip;

		GetComponent<AudioSource>().Play ();
		movie.Play ();

		StartCoroutine(WaitAndLoad(27f, 1));

	}
Esempio n. 40
0
        public void Play(Texture movie)
        {
#if SUPPORTMOVIE
            if (_Fading != null)
            {
                _Fading.Alpha = 1.0f;
            }

            if (_LastMovie != null)
            {
                _LastMovie.Stop();
                if (_Audio != null && _LastMovie.audioClip != null)
                {
                    _Audio.Stop();
                    _Audio.clip = null;
                }
            }
            if (movie != null && movie is MovieTexture)
            {
                MovieTexture movieTexture = (MovieTexture)movie;

                _LastMovie = movieTexture;
                movieTexture.Play();
                if (_Audio != null && movieTexture.audioClip != null)
                {
                    _Audio.clip = movieTexture.audioClip;
                    _Audio.Play();
                }
                if (_Fading != null)
                {
                    _Fading.FadeToZero(true);
                    _MovieTW.Begin(Mathf.Max(movieTexture.duration - _Fading.FadeOutTime, _Fading.FadeOutTime + 0.1f));
                }
                else
                {
                    _MovieTW.Begin(movieTexture.duration);
                }

                _EndTW.End();
                _ImgMovie.Texture     = movie;// change texture
                _SavedCutSceneEnable  = Global.CutSceneEnable;
                Global.CutSceneEnable = CutSceneEnable;
                if (SceneFading != null)
                {
                    SceneFading.FadeToOne();
                }
                OnBegin();
            }
            else
            {
                _ImgMovie.Texture = null;
            }
            enabled = true;
#endif
        }
Esempio n. 41
0
    public void ChoixVideo()
    {
        NomVarriableEmotion = dialogue.EmotionTest;

        NuméroVarEtat = dialogue.newItem;
        NewChemin     = "Video/";
        Debug.Log(NomVarriableEmotion);



        if (File.Exists(Chemin + "video_1.mp4"))
        {
            Debug.Log("Exists" + Chemin);
            Debug.Log("Exists" + NomVarriableEmotion);
            Debug.Log("Exists" + NuméroVarEtat);
            System.IO.Directory.CreateDirectory(NewChemin);
            Debug.Log("new chemin" + NewChemin);
            //  Texturedynamique = (MovieTexture)Resources.Load("Video/" + NomVarriableEmotion + "_" + NomVarriableEtat);
            //Texturedynamique = (MovieTexture)Resources.Load("video_2");
            //Texturedynamique = (MovieTexture)Resources.Load("video_2.mp4") as MovieTexture;
            NomVarriableEmotion = "video";
            NuméroVarEtat       = 2;
            Texturedynamique    = (MovieTexture)Resources.Load(NewChemin + NomVarriableEmotion + NuméroVarEtat);
            GetComponent <RawImage>().texture = Texturedynamique;

            Debug.Log("Il charge quelquechose");

            //Texturedynamique.Play();
        }
        else
        {
            Debug.Log("Ce chemin n'existe pas");
            GetComponent <RawImage>().texture = Texturedynamique as MovieTexture;
            Texturedynamique.Play();
            Texturedynamique.loop = true;
        }
        //Texturedynamique = (MovieTexture)Resources.Load("Vidéo/" + NomVarriableEmotion + "_" + NomVarriableEtat);

        //NomVideo.loadVideoIntoMovieTexture(Texturedynamique);
        //Texturedynamique = movie2;

        //Texturedynamique.Play();

        // string NomVideo;

        //NomVideo = Asset.name;



        // Texturedynamique = NomVideo.movie;


        // movie = NomVideo as MovieTexture;
        //movie = GameObjectby
    }
Esempio n. 42
0
    // Use this for initialization
    void Start()
    {
        Path0_0 = new List <Vector3>();
        Path0_1 = new List <Vector3>();
        Path1_0 = new List <Vector3>();
        Path1_1 = new List <Vector3>();

        MT_Movie = MR.GetComponent <MeshRenderer>().material;
        MT_Movie.SetTexture("_MainTex", MT);
        MT.Play();
        MT.loop = true;

        SetMaterialColor();

        for (int i = 0; i < path0.transform.childCount; ++i)
        {
            Path0_0.Add(path0.transform.GetChild(i).transform.position);
        }

        for (int i = 0; i < path1.transform.childCount; ++i)
        {
            Path1_0.Add(path1.transform.GetChild(i).transform.position);
        }

        for (int i = Path0_0.Count - 1; i >= 0; --i)
        {
            Path0_1.Add(Path0_0[i]);
        }

        for (int i = Path1_0.Count - 1; i >= 0; --i)
        {
            Path1_1.Add(Path1_0[i]);
        }

        if (!IsSelected)
        {
            StartCoroutine(MovieStop());
        }

        EventDispatcher.AddEventListener(EventDefine.Event_Select_Map_Move_Left, OnLeft);
        EventDispatcher.AddEventListener(EventDefine.Event_Select_Map_Move_Right, OnRight);
    }
Esempio n. 43
0
    // Use this for initialization
    void Start()
    {
        //play music source
        audioSource = GetComponent<AudioSource> ();
        audioSource.clip = music;
        audioSource.Play();

        //audioSource.PlayOneShot (voiceovers [curIndex]);
        movTerxture = (GetComponent<MeshRenderer>().materials[0].mainTexture as MovieTexture);
        movTerxture.Play ();
    }
Esempio n. 44
0
    void OnEnable()
    {
        Debug.Log("video 2 here");
        GetComponent <Renderer>().material.mainTexture = movTexture;

        movTexture.loop = true;

        movTexture.Stop();
        movTexture.Play();
        StartCoroutine(Timer1());
    }
Esempio n. 45
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space) && movie.isPlaying)
     {
         movie.Pause();
     }
     else if (Input.GetKeyDown(KeyCode.Space) && !movie.isPlaying)
     {
         movie.Play();
     }
 }
Esempio n. 46
0
    void Hide()
    {
        MOVIE_TEXTURE.Play();
        movieAudio.Play();

        VideoController.Instance.circle_tr.SetActive(false);
        VideoController.Instance.canvas_ui.SetActive(false);
        VRStandardAssets.Utils.Reticle.Instance.Hide();

        MotionController.Instance.state = true;
    }
Esempio n. 47
0
 // Update is called once per frame
 void Update()
 {
     if (!playIntro && !IntroVideo.isPlaying)
     {
         playIntro = true;
         Menu.SetActive(true);
         GetComponent <RawImage>().texture = VideoBoucle;
         VideoBoucle.Play();
         VideoBoucle.loop = true;
     }
 }
Esempio n. 48
0
 void switchToIntro()
 {
     movie      = currentTexture = introMovie;
     movie.loop = false;
     GetComponent <Renderer> ().material.mainTexture = movie;
     movie.Stop();
     if (isPlaying)
     {
         movie.Play();
     }
 }
Esempio n. 49
0
    // Update is called once per frame
    void Update()
    {
        loadingText.color = new Color(loadingText.color.r, loadingText.color.g, loadingText.color.b, Mathf.PingPong(Time.time, 1));

        MovieTexture pelicula = (MovieTexture)GetComponent <Renderer> ().material.mainTexture;

        if (!pelicula.isPlaying)
        {
            pelicula.Play();
        }
    }
Esempio n. 50
0
    void switchVideo()
    {
        video1.Stop();
        aud.Stop();
        r.material.mainTexture = video2 as MovieTexture;
        video2.Play();
        aud.clip = audio2;
        aud.Play();

        isSwitch = false;
    }
 void Start()
 {
     doc.GetComponent <TiraarDocumento>().enabled = false;
     GetComponent <RawImage>().texture            = movie as MovieTexture;
     som      = GetComponent <AudioSource>();
     som.clip = movie.audioClip;
     som.Play();
     movie.Play();
     Canvas.GetComponent <AudioSource>().Pause();
     Time.timeScale = 0;
 }
Esempio n. 52
0
    // Use this for initialization
    void Start()
    {
        //Renderer r = GetComponent<Image>().material.mainTexture;
        movie      = GetComponent <Image>().material.mainTexture as MovieTexture;
        movie.loop = true;

        vsyncprevious = QualitySettings.vSyncCount;
        QualitySettings.vSyncCount = 0;

        movie.Play();
    }
Esempio n. 53
0
        public override void Run()
        {
            Debug.Log(VideoSource + " run");
            targetObject.GetComponent <MeshRenderer>().enabled = true;
            MovieTexture movieTexture = (MovieTexture)Resources.Load("videos/" + VideoSource) as MovieTexture;

            targetObject.GetComponent <Renderer>().material.mainTexture = movieTexture;
            MovieTexture movieComponent = ((MovieTexture)targetObject.GetComponent <Renderer>().material.mainTexture);

            movieComponent.Play();
        }
Esempio n. 54
0
 void PlayMovieClip()
 {
     m_movie.Stop();
     m_movie.Play();
     m_FLeftSrc.Play();
     m_FRightSrc.Play();
     m_BLeftSrc.Play();
     m_BRightSrc.Play();
     m_BaseSrc.Play();
     m_CenterSrc.Play();
 }
Esempio n. 55
0
 public void changeStatusOfMovie()
 {
     if (!isPlaying)
     {
         TurnLightOff(light);
         movie.Play();
         audio.Play();
         isPlaying = true;
         Invoke("IsVideoPlayingFalse", audio.clip.length);
     }
 }
Esempio n. 56
0
    void Awake()
    {
        rt = GetComponent <RectTransform>();


        RawImage rim = GetComponent <RawImage>();

        mt = (MovieTexture)rim.mainTexture;
        mt.Play();
        mt.loop = true;
    }
Esempio n. 57
0
    void Start()
    {
        rt = GetComponent<RectTransform>();
        ac = GetComponent<AudioSource>();
        origPos = rt.anchoredPosition;
        RawImage rim = GetComponent<RawImage>();
        mt = (MovieTexture)rim.mainTexture;
        mt.Play();
        ac.Play();

    }
Esempio n. 58
0
 public void PlayMovie(MovieTexture m, AudioClip a)
 {
     this.movie = m;
     audio.clip = a;
     renderer.material.mainTexture = movie as MovieTexture;
     movie.loop = false;
     movie.Stop ();
     audio.loop = false;
     audio.Stop();
     audio.Play ();
     movie.Play();
 }
Esempio n. 59
0
    // Use this for initialization
    void Start()
    {
        movTexture = Resources.Load ("logomov") as MovieTexture;
        audioclip = Resources.Load ("logowav") as AudioClip;
        GetComponent<Renderer> ().material.mainTexture = movTexture;
        GetComponent<AudioSource> ().clip = audioclip;

        movTexture.loop = false;
        if (!movTexture.isPlaying) {
            movTexture.Play ();
            GetComponent<AudioSource> ().Play ();
        }
        PlayerPrefs.DeleteAll ();
    }
Esempio n. 60
0
 // Use this for initialization
 void Start()
 {
     Cursor.visible = false;
     movie = GetComponent<RawImage> ().texture as MovieTexture;
     movie.wrapMode = TextureWrapMode.Clamp;
     movie.loop = false;
     movie.Play ();
     movie.wrapMode = TextureWrapMode.Repeat;
     Debug.Log("About to start coroutine");
     if (NextScene != "credits" || Application.loadedLevelName != "credits") {
         StartCoroutine ("load");
     }
     StartCoroutine(WaitUntilEnd());
 }