Exemplo n.º 1
0
 private void _OnPlaybackCompleted(MPMP mpmp)
 {
     Debug.Log("API Test::_OnPlaybackCompleted:" + mpmp.name);
     if (videoTransform != null)
     {
         Vector2 size = mpmp.GetNativeVideoSize();
         videoTransform.localScale = new Vector3(size.x, size.y, 1f) * 0.0011f;
         videoTransform.GetComponent <MPMPScaleFlip>().DoFlip();
     }
 }
Exemplo n.º 2
0
        static void _NewMPMP()
        {
            //Debug.Log("_NewMPMP");
            GameObject go   = new GameObject("MPMP.instance");
            MPMP       mpmp = go.AddComponent <MPMP>();

            mpmp.volume   = 1.0f;
            mpmp.autoPlay = true;
            mpmp.looping  = true;
        }
Exemplo n.º 3
0
        private void _OnLoaded(MPMP mpmp)
        {
            Debug.Log("API Test::OnLoaded:" + mpmp.name);
            Vector2 size     = mpmp.GetNativeVideoSize();
            double  duration = mpmp.GetDuration();

            Debug.Log(String.Format("NativeVideoSize: w:{0}, h:{1}", size.x, size.y));
            Debug.Log(String.Format("Duration: {0} in seconds", duration));
            if (videoTransform != null)
            {
                videoTransform.localScale = new Vector3(size.x, size.y, 1f) * 0.002f;
                videoTransform.GetComponent <MPMPScaleFlip>().DoFlip();
            }
        }
Exemplo n.º 4
0
        void _OnPlaybackCompleted(MPMP instance)
        {
            mpmpMaster.SeekTo(0f);
            _mpmpClients.ForEach(c => { if (c != null)
                                        {
                                            c.SeekTo(0f);
                                        }
                                 });

            mpmpMaster.Play();
            _mpmpClients.ForEach(c => { if (c != null)
                                        {
                                            c.Play();
                                        }
                                 });
        }
Exemplo n.º 5
0
        void OnEnable()
        {
            if (target != _target)
            {
                _target = target as MPMP;
            }

            serializedObject.Update();

            // EditorApplication.update -= EditorApplicationUpdate;
            // EditorApplication.update += EditorApplicationUpdate;
            filtermodeProp = serializedObject.FindProperty("_filtermode");

            videoPathProp           = serializedObject.FindProperty("videoPath");
            videoMaterialProp       = serializedObject.FindProperty("_videoMaterial");
            texturePropertyNameProp = serializedObject.FindProperty("texturePropertyName");

            autoPlayProp   = serializedObject.FindProperty("_autoPlay");
            loopingProp    = serializedObject.FindProperty("_looping");
            forceGammaProp = serializedObject.FindProperty("forceGamma");
            volumeProp     = serializedObject.FindProperty("_volume");
            balanceProp    = serializedObject.FindProperty("_balance");

            foldoutPreviewProp  = serializedObject.FindProperty("_foldoutPreview");
            updateFrequencyProp = serializedObject.FindProperty("_updateFrequency");

            preventFlickerProp = serializedObject.FindProperty("_preventFlicker");



            //flipYProp = serializedObject.FindProperty("_flipY");
            tex_logo    = Resources.Load(MPMP.LOGO64_NAME, typeof(Texture2D)) as Texture2D;
            _pauseColor = new Color(1.0f, 0.5f, 0f);
            _playColor  = Color.green;
            _loadColor  = Color.red;
            _stopColor  = Color.red;

            _isOnWindows = Application.platform.ToString().StartsWith("Windows");
        }
 public void SetupSphereUV()
 {
     MPMP.Set_VR_UV(_meshf, vrMode);
 }
Exemplo n.º 7
0
 private void _OnError(MPMP mpmp)
 {
     Debug.LogError("API Test::_OnError:" + mpmp.name);
     newVideoMaterial.color = new Color(1f, 0f, 0f);
 }
Exemplo n.º 8
0
 private void _OnDestroyed(MPMP mpmp)
 {
     Debug.Log("API Test::OnDestroyed:" + mpmp.name);
 }
Exemplo n.º 9
0
 private void _OnLoad(MPMP mpmp)
 {
     Debug.Log("API Test::OnLoad:" + mpmp.name);
 }