AssetImporter for importing MovieTextures.

Inheritance: AssetImporter
        public override void OnInspectorGUI()
        {
            MovieImporter x = base.target as MovieImporter;

            if (x != null)
            {
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                this.m_linearTexture = EditorGUILayout.Toggle(MovieImporterInspector.linearTextureContent, this.m_linearTexture, new GUILayoutOption[0]);
                int   num  = (int)(this.GetVideoBitrateForQuality((double)this.m_quality) + this.GetAudioBitrateForQuality((double)this.m_quality));
                float num2 = (float)(num / 8) * this.m_duration;
                float num3 = 1048576f;
                this.m_quality = EditorGUILayout.Slider("Quality", this.m_quality, 0f, 1f, new GUILayoutOption[0]);
                GUILayout.Label(string.Format("Approx. {0:0.00} " + ((num2 >= num3) ? "MB" : "kB") + ", {1} kbps", num2 / ((num2 >= num3) ? num3 : 1024f), num / 1000), EditorStyles.helpBox, new GUILayoutOption[0]);
                GUILayout.EndVertical();
            }
            base.ApplyRevertGUI();
            MovieTexture movieTexture = this.assetEditor.target as MovieTexture;

            if (movieTexture && movieTexture.loop)
            {
                EditorGUILayout.Space();
                movieTexture.loop = EditorGUILayout.Toggle("Loop", movieTexture.loop, new GUILayoutOption[0]);
                GUILayout.Label("The Loop setting in the Inspector is obsolete. Use the Scripting API to control looping instead.\n\nThe loop setting will be disabled on next re-import or by disabling it above.", EditorStyles.helpBox, new GUILayoutOption[0]);
            }
        }
示例#2
0
        internal override void Apply()
        {
            MovieImporter target = this.target as MovieImporter;

            target.quality       = this.m_quality;
            target.linearTexture = this.m_linearTexture;
        }
        protected override void Apply()
        {
            MovieImporter movieImporter = base.target as MovieImporter;

            movieImporter.quality       = this.m_quality;
            movieImporter.linearTexture = this.m_linearTexture;
        }
示例#4
0
        public override void OnInspectorGUI()
        {
            MovieImporter importer = target as MovieImporter;

            if (importer != null)
            {
                GUILayout.BeginVertical();

                m_linearTexture = EditorGUILayout.Toggle(linearTextureContent, m_linearTexture);

                int   bitrate = (int)(GetVideoBitrateForQuality(m_quality) + GetAudioBitrateForQuality(m_quality));
                float size    = (bitrate / 8 * m_duration);
                float kbsize  = 1024.0f * 1024.0f;

                m_quality = EditorGUILayout.Slider("Quality", m_quality, 0.0f, 1.0f);
                GUILayout.Label(
                    string.Format("Approx. {0:0.00} " + (size < kbsize ? "kB" : "MB") + ", {1} kbps",
                                  size / (size < kbsize ? 1024.0f : kbsize), bitrate / 1000), EditorStyles.helpBox);
                GUILayout.EndVertical();
            }

            ApplyRevertGUI();

            MovieTexture movie = assetTarget as MovieTexture;

            if (movie && movie.loop)
            {
                EditorGUILayout.Space();
                movie.loop = EditorGUILayout.Toggle("Loop", movie.loop);
                GUILayout.Label("The Loop setting in the Inspector is obsolete. Use the Scripting API to control looping instead.\n\nThe loop setting will be disabled on next re-import or by disabling it above.", EditorStyles.helpBox);
            }
        }
示例#5
0
        protected override void Apply()
        {
            MovieImporter importer = target as MovieImporter;

            importer.quality       = m_quality;
            importer.linearTexture = m_linearTexture;
        }
        protected override void ResetValues()
        {
            MovieImporter movieImporter = base.target as MovieImporter;

            this.m_quality       = movieImporter.quality;
            this.m_linearTexture = movieImporter.linearTexture;
            this.m_duration      = movieImporter.duration;
        }
示例#7
0
        internal override void ResetValues()
        {
            MovieImporter target = this.target as MovieImporter;

            this.m_quality       = target.quality;
            this.m_linearTexture = target.linearTexture;
            this.m_duration      = target.duration;
        }
示例#8
0
        protected override void ResetValues()
        {
            MovieImporter importer = target as MovieImporter;

            m_quality       = importer.quality;
            m_linearTexture = importer.linearTexture;
            // only read out this once (its pretty slow)
            m_duration = importer.duration;
        }
        internal override bool HasModified()
        {
            MovieImporter target = this.target as MovieImporter;

            if ((double)target.quality == (double)this.m_quality)
            {
                return(target.linearTexture != this.m_linearTexture);
            }
            return(true);
        }
        public override bool HasModified()
        {
            MovieImporter movieImporter = base.target as MovieImporter;

            return(movieImporter.quality != this.m_quality || movieImporter.linearTexture != this.m_linearTexture);
        }
示例#11
0
        internal override bool HasModified()
        {
            MovieImporter target = this.target as MovieImporter;

            return((target.quality != this.m_quality) || (target.linearTexture != this.m_linearTexture));
        }
示例#12
0
        public override bool HasModified()
        {
            MovieImporter importer = target as MovieImporter;

            return(importer.quality != m_quality || importer.linearTexture != m_linearTexture);
        }