public void Deinit() { if (_updateUsingCoroutine) { StopCoroutine("FinalRenderCapture"); } // Clean up any open movies AVProQuickTimeMovie[] movies = (AVProQuickTimeMovie[])FindObjectsOfType(typeof(AVProQuickTimeMovie)); if (movies != null && movies.Length > 0) { for (int i = 0; i < movies.Length; i++) { movies[i].UnloadMovie(); } } _instance = null; _isInitialised = false; #if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52 _nativeFunction_UpdateAllTextures = System.IntPtr.Zero; #endif AVProQuickTimePlugin.Deinit(); }
//------------------------------------------------------------------------- void Start() { if (!_isInitialised) { _instance = this; Init(); } }
//------------------------------------------------------------------------- void Awake() { if (!_isInitialised) { _instance = this; Init(); } }
public void Deinit() { // Clean up any open movies AVProQuickTimeMovie[] movies = (AVProQuickTimeMovie[])FindObjectsOfType(typeof(AVProQuickTimeMovie)); if (movies != null && movies.Length > 0) { for (int i = 0; i < movies.Length; i++) { movies[i].UnloadMovie(); } } _instance = null; _isInitialised = false; AVProQuickTimePlugin.Deinit(); }
public override void OnInspectorGUI() { _manager = (this.target) as AVProQuickTimeManager; if (!Application.isPlaying) { this.DrawDefaultInspector(); } if (GUILayout.Button ("Update")) { UpdateMovies(); } if (_movies != null && _movies.Length > 0) { for (int i = 0; i < _movies.Length; i++) { GUILayout.BeginHorizontal(); GUI.color = Color.white; if (!_movies[i].enabled || #if !AVPRO_UNITY_4_X !_movies[i].gameObject.active #else !_movies[i].gameObject.activeInHierarchy #endif ) GUI.color = Color.grey; AVProQuickTime media = _movies[i].MovieInstance; if (media != null) { GUI.color = Color.yellow; if (media.IsPlaying) GUI.color = Color.green; } if (GUILayout.Button("S")) { Selection.activeObject = _movies[i]; } GUILayout.Label(i.ToString("D2") + " " + _movies[i].name, GUILayout.MinWidth(128f)); //GUILayout.FlexibleSpace(); if (media != null) { GUILayout.Label(media.Width + "x" + media.Height); GUILayout.FlexibleSpace(); GUILayout.Label(string.Format("{0:00.0}", media.DisplayFPS) + " FPS"); //GUILayout.FlexibleSpace(); } else { GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); if (media != null) { GUILayout.HorizontalSlider(media.PositionSeconds, 0f, media.DurationSeconds, GUILayout.MinWidth(128f), GUILayout.ExpandWidth(true)); } } #if !AVPROQUICKTIME_UNITYFEATURE_EDITORAUTOREFRESH if (Application.isPlaying) { this.Repaint(); } #endif } else { if (Event.current.type.Equals(EventType.Repaint)) { UpdateMovies(); } } if (GUI.changed) { EditorUtility.SetDirty(_manager); } }
public override void OnInspectorGUI() { _manager = (this.target) as AVProQuickTimeManager; if (!Application.isPlaying) { this.DrawDefaultInspector(); } if (GUILayout.Button("Update")) { UpdateMovies(); } if (_movies != null && _movies.Length > 0) { for (int i = 0; i < _movies.Length; i++) { GUILayout.BeginHorizontal(); GUI.color = Color.white; if (!_movies[i].enabled || #if !AVPRO_UNITY_4_X !_movies[i].gameObject.active #else !_movies[i].gameObject.activeInHierarchy #endif ) { GUI.color = Color.grey; } AVProQuickTime media = _movies[i].MovieInstance; if (media != null) { GUI.color = Color.yellow; if (media.IsPlaying) { GUI.color = Color.green; } } if (GUILayout.Button("S")) { Selection.activeObject = _movies[i]; } GUILayout.Label(i.ToString("D2") + " " + _movies[i].name, GUILayout.MinWidth(128f)); //GUILayout.FlexibleSpace(); if (media != null) { GUILayout.Label(media.Width + "x" + media.Height); GUILayout.FlexibleSpace(); GUILayout.Label(string.Format("{0:00.0}", media.DisplayFPS) + " FPS"); //GUILayout.FlexibleSpace(); } else { GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); if (media != null) { GUILayout.HorizontalSlider(media.PositionSeconds, 0f, media.DurationSeconds, GUILayout.MinWidth(128f), GUILayout.ExpandWidth(true)); } } #if !AVPROQUICKTIME_UNITYFEATURE_EDITORAUTOREFRESH if (Application.isPlaying) { this.Repaint(); } #endif } else { if (Event.current.type.Equals(EventType.Repaint)) { UpdateMovies(); } } if (GUI.changed) { EditorUtility.SetDirty(_manager); } }