Ejemplo n.º 1
0
    private void OnGUI()
    {
        GUILayout.BeginArea(new Rect(0.0f, 0.0f, Screen.width, Screen.height));

        var currentPosition = (float)m_movieTexture.playPosition;

        var newPosition = GUILayout.HorizontalSlider(currentPosition, 0.0f, (float)m_movieTexture.duration);

        if (newPosition != currentPosition)
        {
            m_movieTexture.playPosition = newPosition;
        }

        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play"))
        {
            m_movieTexture.Play();
        }

        if (GUILayout.Button("Play/Pause"))
        {
            m_movieTexture.pause = !m_movieTexture.pause;
        }

        if (GUILayout.Button("Stop"))
        {
            m_movieTexture.Stop();
        }

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.EndArea();
    }
Ejemplo n.º 2
0
    public void playMovie()
    {
        if (mMT.IsPlaying)
        {
            mMT.Stop();
        }
        string videoPath = "GamePlay/" + gamePlayName + ".ogv";

        mMT.Path = videoPath;
        Debug.Log(mMT.Path);
        mMT.Play();
    }
Ejemplo n.º 3
0
    private void OnGUI()
    {
        GUILayout.BeginArea(new Rect(0.0f, 0.0f, Screen.width, Screen.height));

        var currentPosition = (float)m_movieTexture.PlayPosition;

        var newPosition = GUILayout.HorizontalSlider(currentPosition, 0.0f, (float)m_movieTexture.Duration);

        if (newPosition != currentPosition)
        {
            m_movieTexture.PlayPosition = newPosition;
        }

        GUILayout.FlexibleSpace();
        GUILayout.BeginHorizontal();

        if (GUILayout.Button(m_movieTexture.IsPlaying ? "Pause" : "Play"))
        {
            if (m_movieTexture.IsPlaying)
            {
                m_movieTexture.Pause = true;
            }
            else
            {
                if (!m_movieTexture.Pause)
                {
                    m_movieTexture.Play();
                }
                else
                {
                    m_movieTexture.Pause = false;
                }
            }
        }

        if (GUILayout.Button("Stop"))
        {
            m_movieTexture.Stop();
        }

        GUILayout.EndHorizontal();

        GUILayout.EndArea();
    }