예제 #1
0
        internal bool GetOptimizedGUIBlockImplementation(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            if (this.m_OptimizedBlock == null)
            {
                this.m_OptimizedBlock = new OptimizedGUIBlock();
            }
            block = this.m_OptimizedBlock;
            if (!isVisible)
            {
                height = 0f;
                return(true);
            }
            if (this.m_SerializedObject == null)
            {
                this.m_SerializedObject = new SerializedObject(this.targets);
            }
            else
            {
                this.m_SerializedObject.Update();
            }
            this.m_SerializedObject.inspectorMode = this.m_InspectorMode;
            SerializedProperty iterator = this.m_SerializedObject.GetIterator();

            height = 2f;
            for (bool flag = true; iterator.NextVisible(flag); flag = false)
            {
                height += EditorGUI.GetPropertyHeight(iterator, null, true) + 2f;
            }
            if (height == 2f)
            {
                height = 0f;
            }
            return(true);
        }
 internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
 {
   bool blockImplementation = this.GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);
   if (this.target is MonoBehaviour && AudioUtil.HaveAudioCallback(this.target as MonoBehaviour) && AudioUtil.GetCustomFilterChannelCount(this.target as MonoBehaviour) > 0 || this.IsMissingMonoBehaviourTarget())
     return false;
   return blockImplementation;
 }
예제 #3
0
        internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            bool blockImplementation = this.GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);

            if (this.target is MonoBehaviour && AudioUtil.HaveAudioCallback(this.target as MonoBehaviour) && AudioUtil.GetCustomFilterChannelCount(this.target as MonoBehaviour) > 0 || this.IsMissingMonoBehaviourTarget())
            {
                return(false);
            }
            return(blockImplementation);
        }
예제 #4
0
 internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
 {
     bool flag = base.GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);
     if ((base.target is MonoBehaviour) && (AudioUtil.HaveAudioCallback(base.target as MonoBehaviour) && (AudioUtil.GetCustomFilterChannelCount(base.target as MonoBehaviour) > 0)))
     {
         return false;
     }
     if (this.IsMissingMonoBehaviourTarget())
     {
         return false;
     }
     return flag;
 }
        private bool ResetOptimizedBlock(OptimizedBlockState resetState = OptimizedBlockState.CheckOptimizedBlock)
        {
            if (m_OptimizedBlock != null)
            {
                m_OptimizedBlock.Dispose();
                m_OptimizedBlock = null;
            }

            m_LastHeight          = -1;
            m_LastOptimizedBlock  = null;
            m_OptimizedBlockState = resetState;
            return(m_OptimizedBlockState == OptimizedBlockState.HasOptimizedBlock);
        }
예제 #6
0
 private void CleanupPropertyEditor()
 {
     if (this.m_OptimizedBlock != null)
     {
         this.m_OptimizedBlock.Dispose();
         this.m_OptimizedBlock = null;
     }
     if (this.m_SerializedObject != null)
     {
         this.m_SerializedObject.Dispose();
         this.m_SerializedObject = null;
     }
 }
예제 #7
0
 private void CleanupPropertyEditor()
 {
     if (this.m_OptimizedBlock != null)
     {
         this.m_OptimizedBlock.Dispose();
         this.m_OptimizedBlock = (OptimizedGUIBlock)null;
     }
     if (this.m_SerializedObject == null)
     {
         return;
     }
     this.m_SerializedObject.Dispose();
     this.m_SerializedObject = (SerializedObject)null;
 }
예제 #8
0
        internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            bool optimizedGUIBlockImplementation = base.GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);
            bool result;

            if (base.target is MonoBehaviour)
            {
                if (AudioUtil.HasAudioCallback(base.target as MonoBehaviour) && AudioUtil.GetCustomFilterChannelCount(base.target as MonoBehaviour) > 0)
                {
                    result = false;
                    return(result);
                }
            }
            result = (!this.IsMissingMonoBehaviourTarget() && optimizedGUIBlockImplementation);
            return(result);
        }
        internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            bool result = GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);

            // Don't use optimizedGUI for audio filters
            if (target is MonoBehaviour)
            {
                if (AudioUtil.HasAudioCallback(target as MonoBehaviour) && AudioUtil.GetCustomFilterChannelCount(target as MonoBehaviour) > 0)
                {
                    return(false);
                }
            }

            if (IsMissingMonoBehaviourTarget())
            {
                return(false);
            }

            return(result);
        }
예제 #10
0
        internal bool GetOptimizedGUIBlockImplementation(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            if (this.m_OptimizedBlock == null)
            {
                this.m_OptimizedBlock = new OptimizedGUIBlock();
            }
            block = this.m_OptimizedBlock;
            bool result;

            if (!isVisible)
            {
                height = 0f;
                result = true;
            }
            else
            {
                if (this.m_SerializedObject == null)
                {
                    this.m_SerializedObject = new SerializedObject(this.targets, this.m_Context);
                }
                else
                {
                    this.m_SerializedObject.Update();
                }
                this.m_SerializedObject.inspectorMode = this.m_InspectorMode;
                SerializedProperty iterator = this.m_SerializedObject.GetIterator();
                height = 2f;
                bool enterChildren = true;
                while (iterator.NextVisible(enterChildren))
                {
                    height       += EditorGUI.GetPropertyHeight(iterator, null, true) + 2f;
                    enterChildren = false;
                }
                if (height == 2f)
                {
                    height = 0f;
                }
                result = true;
            }
            return(result);
        }
예제 #11
0
        internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            bool optimizedGUIBlockImplementation = base.GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);

            return((!(this.target is MonoBehaviour) || !AudioUtil.HaveAudioCallback(this.target as MonoBehaviour) || AudioUtil.GetCustomFilterChannelCount(this.target as MonoBehaviour) <= 0) && !this.IsMissingMonoBehaviourTarget() && optimizedGUIBlockImplementation);
        }
예제 #12
0
		internal virtual bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
		{
			block = null;
			height = -1f;
			return false;
		}
예제 #13
0
		internal bool GetOptimizedGUIBlockImplementation(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
		{
			if (this.m_OptimizedBlock == null)
			{
				this.m_OptimizedBlock = new OptimizedGUIBlock();
			}
			block = this.m_OptimizedBlock;
			if (!isVisible)
			{
				height = 0f;
				return true;
			}
			if (this.m_SerializedObject == null)
			{
				this.m_SerializedObject = new SerializedObject(this.targets);
			}
			else
			{
				this.m_SerializedObject.Update();
			}
			this.m_SerializedObject.inspectorMode = this.m_InspectorMode;
			SerializedProperty iterator = this.m_SerializedObject.GetIterator();
			height = 2f;
			bool enterChildren = true;
			while (iterator.NextVisible(enterChildren))
			{
				height += EditorGUI.GetPropertyHeight(iterator, null, true) + 2f;
				enterChildren = false;
			}
			if (height == 2f)
			{
				height = 0f;
			}
			return true;
		}
 internal static extern void Internal_EndRecording(OptimizedGUIBlock self);
예제 #15
0
		internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
		{
			bool optimizedGUIBlockImplementation = base.GetOptimizedGUIBlockImplementation(isDirty, isVisible, out block, out height);
			return (!(this.target is MonoBehaviour) || !AudioUtil.HaveAudioCallback(this.target as MonoBehaviour) || AudioUtil.GetCustomFilterChannelCount(this.target as MonoBehaviour) <= 0) && !this.IsMissingMonoBehaviourTarget() && optimizedGUIBlockImplementation;
		}
        internal override bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            block = null; height = -1;

            // Don't use optimizedGUI for audio filters
            var behaviour = target as MonoBehaviour;

            if (behaviour != null && AudioUtil.HasAudioCallback(behaviour) && AudioUtil.GetCustomFilterChannelCount(behaviour) > 0)
            {
                return(false);
            }

            if (IsMissingMonoBehaviourTarget())
            {
                return(false);
            }

            if (isDirty && m_OptimizedBlock != null)
            {
                ResetOptimizedBlock();
            }

            if (!isVisible)
            {
                if (m_OptimizedBlock == null)
                {
                    m_OptimizedBlock = new OptimizedGUIBlock();
                }

                height = 0;
                block  = m_OptimizedBlock;
                return(true);
            }

            // Return cached result if any.
            if (m_OptimizedBlockState != OptimizedBlockState.CheckOptimizedBlock)
            {
                if (m_OptimizedBlockState == OptimizedBlockState.NoOptimizedBlock)
                {
                    return(false);
                }
                height = m_LastHeight;
                block  = m_LastOptimizedBlock;
                return(true);
            }

            // Update serialized object representation
            if (m_SerializedObject == null)
            {
                m_SerializedObject = new SerializedObject(targets, m_Context)
                {
                    inspectorMode = m_InspectorMode
                }
            }
            ;
            else
            {
                m_SerializedObject.Update();
                m_SerializedObject.inspectorMode = m_InspectorMode;
            }

            height = 0;
            SerializedProperty property = m_SerializedObject.GetIterator();

            while (property.NextVisible(height <= 0))
            {
                var handler = ScriptAttributeUtility.GetHandler(property);
                if (!handler.CanCacheInspectorGUI(property))
                {
                    return(ResetOptimizedBlock(OptimizedBlockState.NoOptimizedBlock));
                }

                // Allocate height for control plus spacing below it
                height += handler.GetHeight(property, null, true) + EditorGUI.kControlVerticalSpacing;
            }

            // Allocate height for spacing above first control
            if (height > 0)
            {
                height += EditorGUI.kControlVerticalSpacing;
            }

            if (m_OptimizedBlock == null)
            {
                m_OptimizedBlock = new OptimizedGUIBlock();
            }

            m_LastHeight          = height;
            m_LastOptimizedBlock  = block = m_OptimizedBlock;
            m_OptimizedBlockState = OptimizedBlockState.HasOptimizedBlock;
            return(true);
        }
예제 #17
0
 private void CleanupPropertyEditor()
 {
   if (this.m_OptimizedBlock != null)
   {
     this.m_OptimizedBlock.Dispose();
     this.m_OptimizedBlock = (OptimizedGUIBlock) null;
   }
   if (this.m_SerializedObject == null)
     return;
   this.m_SerializedObject.Dispose();
   this.m_SerializedObject = (SerializedObject) null;
 }
예제 #18
0
 internal bool GetOptimizedGUIBlockImplementation(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
 {
   if (this.m_OptimizedBlock == null)
     this.m_OptimizedBlock = new OptimizedGUIBlock();
   block = this.m_OptimizedBlock;
   if (!isVisible)
   {
     height = 0.0f;
     return true;
   }
   if (this.m_SerializedObject == null)
     this.m_SerializedObject = new SerializedObject(this.targets);
   else
     this.m_SerializedObject.Update();
   this.m_SerializedObject.inspectorMode = this.m_InspectorMode;
   SerializedProperty iterator = this.m_SerializedObject.GetIterator();
   height = 2f;
   for (bool enterChildren = true; iterator.NextVisible(enterChildren); enterChildren = false)
     height = height + (EditorGUI.GetPropertyHeight(iterator, (GUIContent) null, true) + 2f);
   if ((double) height == 2.0)
     height = 0.0f;
   return true;
 }
예제 #19
0
 internal virtual bool GetOptimizedGUIBlock(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
 {
     block  = null;
     height = -1;
     return(false);
 }
예제 #20
0
		private void CleanupPropertyEditor()
		{
			if (this.m_OptimizedBlock != null)
			{
				this.m_OptimizedBlock.Dispose();
				this.m_OptimizedBlock = null;
			}
			if (this.m_SerializedObject != null)
			{
				this.m_SerializedObject.Dispose();
				this.m_SerializedObject = null;
			}
		}
 internal static extern void Internal_Execute(OptimizedGUIBlock self);
        internal bool GetOptimizedGUIBlockImplementation(bool isDirty, bool isVisible, out OptimizedGUIBlock block, out float height)
        {
            if (isDirty && m_OptimizedBlock != null)
            {
                m_OptimizedBlock.Dispose();
                m_OptimizedBlock = null;
            }

            if (!isVisible)
            {
                if (m_OptimizedBlock == null)
                {
                    m_OptimizedBlock = new OptimizedGUIBlock();
                }
                block  = m_OptimizedBlock;
                height = 0;
                return(true);
            }

            if (m_SerializedObject == null)
            {
                m_SerializedObject = new SerializedObject(targets, m_Context);
            }
            else
            {
                m_SerializedObject.Update();
            }
            m_SerializedObject.inspectorMode = m_InspectorMode;

            SerializedProperty property = m_SerializedObject.GetIterator();

            height = EditorGUI.kControlVerticalSpacing;
            bool expand = true;

            while (property.NextVisible(expand))
            {
                if (!EditorGUI.CanCacheInspectorGUI(property))
                {
                    if (m_OptimizedBlock != null)
                    {
                        m_OptimizedBlock.Dispose();
                    }
                    block = m_OptimizedBlock = null;
                    return(false);
                }

                height += EditorGUI.GetPropertyHeight(property, null, true) + EditorGUI.kControlVerticalSpacing;
                expand  = false;
            }

            if (height == EditorGUI.kControlVerticalSpacing)
            {
                height = 0;
            }

            if (m_OptimizedBlock == null)
            {
                m_OptimizedBlock = new OptimizedGUIBlock();
            }
            block = m_OptimizedBlock;
            return(true);
        }