Esempio n. 1
0
        private void ProcessOverrideEnabledToggle(bool newValue)
        {
            string storedValue  = m_CanChangeShaderGUI.ShaderGUIOverride;
            string preferredGUI = GraphUtil.CurrentPipelinePreferredShaderGUI(m_MasterNode as IMasterNode);

            m_CanChangeShaderGUI.OverrideEnabled = newValue;

            // Display the ShaderGUI text field only when the override is enabled
            if (m_CanChangeShaderGUI.OverrideEnabled)
            {
                m_PropertySheet.Add(m_OverrideFieldRow);

                // Display the pipeline's default upon activation, if it has one. Otherwise set up field to display user setting.
                if (string.IsNullOrEmpty(storedValue) && !string.IsNullOrEmpty(preferredGUI))
                {
                    ProcessShaderGUIField(preferredGUI, false);
                }
                else
                {
                    ProcessShaderGUIField(storedValue, false);
                }
            }
            else if (m_PropertySheet.Contains(m_OverrideFieldRow))
            {
                m_PropertySheet.Remove(m_OverrideFieldRow);

                // Upon disable, set the value back to null (for pipeline switching reasons, among other reasons)
                if (storedValue == preferredGUI)
                {
                    m_CanChangeShaderGUI.ShaderGUIOverride = null;
                }
            }

            AddWarningIfNeeded();
        }
        private void ProcessOverrideEnabledToggle(bool newValue)
        {
            string storedValue = m_CanChangeShaderGUI.ShaderGUIOverride;

            m_CanChangeShaderGUI.OverrideEnabled = newValue;

            // Display the ShaderGUI text field only when the override is enabled
            if (m_CanChangeShaderGUI.OverrideEnabled)
            {
                m_PropertySheet.Add(m_OverrideFieldRow);

                ProcessShaderGUIField(storedValue, false);
            }
            else if (m_PropertySheet.Contains(m_OverrideFieldRow))
            {
                m_PropertySheet.Remove(m_OverrideFieldRow);
            }

            AddWarningIfNeeded();
        }