public void ReadFromString(ref uint index, ref string[] nodeParams)
        {
            for (int i = 0; i < m_codeGenerationDataList.Count; i++)
            {
                m_codeGenerationDataList[i].IsActive = Convert.ToBoolean(nodeParams[index++]);
            }

            if (UIUtils.CurrentShaderVersion() > 10005)
            {
                m_lodCrossfade = Convert.ToBoolean(nodeParams[index++]);
            }

            if (UIUtils.CurrentShaderVersion() > 10007)
            {
                m_disableBatching      = (DisableBatchingTagValues)Enum.Parse(typeof(DisableBatchingTagValues), nodeParams[index++]);
                m_ignoreProjector      = Convert.ToBoolean(nodeParams[index++]);
                m_forceNoShadowCasting = Convert.ToBoolean(nodeParams[index++]);
            }

            if (UIUtils.CurrentShaderVersion() > 11002)
            {
                m_forceEnableInstancing = Convert.ToBoolean(nodeParams[index++]);
            }

            if (UIUtils.CurrentShaderVersion() > 15205)
            {
                m_forceDisableInstancing = Convert.ToBoolean(nodeParams[index++]);
            }

            if (UIUtils.CurrentShaderVersion() > 14403)
            {
                m_specularHighlightToggle = Convert.ToBoolean(nodeParams[index++]);
                m_reflectionsToggle       = Convert.ToBoolean(nodeParams[index++]);
            }
        }
        public void Draw(ParentNode owner)
        {
            bool value = EditorVariablesManager.ExpandedRenderingOptions.Value;

            NodeUtils.DrawPropertyGroup(ref value, RenderingOptionsStr, () =>
            {
                int codeGenCount = m_codeGenerationDataList.Count;
                // Starting from index 4 because other options are already contemplated with m_renderPath and add/receive shadows
                for (int i = 4; i < codeGenCount; i++)
                {
                    m_codeGenerationDataList[i].IsActive = !owner.EditorGUILayoutToggleLeft(m_codeGenerationDataList[i].Name, !m_codeGenerationDataList[i].IsActive);
                }
                m_lodCrossfade         = owner.EditorGUILayoutToggleLeft(LODCrossfadeContent, m_lodCrossfade);
                m_ignoreProjector      = owner.EditorGUILayoutToggleLeft(IgnoreProjectorContent, m_ignoreProjector);
                m_forceNoShadowCasting = owner.EditorGUILayoutToggleLeft(ForceNoShadowCastingContent, m_forceNoShadowCasting);
                if (owner.ContainerGraph.IsInstancedShader)
                {
                    GUI.enabled = false;
                    owner.EditorGUILayoutToggleLeft(ForceEnableInstancingContent, true);
                    GUI.enabled = true;
                }
                else
                {
                    m_forceEnableInstancing = owner.EditorGUILayoutToggleLeft(ForceEnableInstancingContent, m_forceEnableInstancing);
                }

#if UNITY_5_6_OR_NEWER
                m_forceDisableInstancing = owner.EditorGUILayoutToggleLeft(ForceDisableInstancingContent, m_forceDisableInstancing);
#endif
                m_specularHighlightToggle = owner.EditorGUILayoutToggleLeft(SpecularHightlightsContent, m_specularHighlightToggle);
                m_reflectionsToggle       = owner.EditorGUILayoutToggleLeft(ReflectionsContent, m_reflectionsToggle);
                m_disableBatching         = (DisableBatchingTagValues)owner.EditorGUILayoutEnumPopup(DisableBatchingContent, m_disableBatching);
            });
            EditorVariablesManager.ExpandedRenderingOptions.Value = value;
        }
        public void Draw(StandardSurfaceOutputNode owner)
        {
            bool value = owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedRenderingOptions;

            NodeUtils.DrawPropertyGroup(ref value, RenderingOptionsStr, () =>
            {
                int codeGenCount = m_codeGenerationDataList.Count;
                // Starting from index 4 because other options are already contemplated with m_renderPath and add/receive shadows
                for (int i = 4; i < codeGenCount; i++)
                {
                    m_codeGenerationDataList[i].IsActive = !owner.EditorGUILayoutToggleLeft(m_codeGenerationDataList[i].Name, !m_codeGenerationDataList[i].IsActive);
                }
                m_lodCrossfade    = owner.EditorGUILayoutToggleLeft(LODCrossfadeContent, m_lodCrossfade);
                m_ignoreProjector = owner.EditorGUILayoutToggleLeft(IgnoreProjectorContent, m_ignoreProjector);
                EditorGUI.BeginDisabledGroup(!owner.CastShadows);
                m_useDefaultShadowCaster = owner.EditorGUILayoutToggleLeft(UseDefaultCasterContent, m_useDefaultShadowCaster);
                EditorGUI.EndDisabledGroup();
                m_forceNoShadowCasting = owner.EditorGUILayoutToggleLeft(ForceNoShadowCastingContent, m_forceNoShadowCasting);
                if (owner.ContainerGraph.IsInstancedShader)
                {
                    GUI.enabled = false;
                    owner.EditorGUILayoutToggleLeft(ForceEnableInstancingContent, true);
                    GUI.enabled = true;
                }
                else
                {
                    m_forceEnableInstancing = owner.EditorGUILayoutToggleLeft(ForceEnableInstancingContent, m_forceEnableInstancing);
                }

#if UNITY_5_6_OR_NEWER
                m_forceDisableInstancing = owner.EditorGUILayoutToggleLeft(ForceDisableInstancingContent, m_forceDisableInstancing);
#endif
                m_specularHighlightToggle = owner.EditorGUILayoutToggleLeft(SpecularHightlightsContent, m_specularHighlightToggle);
                m_reflectionsToggle       = owner.EditorGUILayoutToggleLeft(ReflectionsContent, m_reflectionsToggle);
                m_disableBatching         = (DisableBatchingTagValues)owner.EditorGUILayoutEnumPopup(DisableBatchingContent, m_disableBatching);
                Material mat = owner.ContainerGraph.CurrentMaterial;
                if (mat != null)
                {
                    mat.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)owner.EditorGUILayoutEnumPopup(EmissionGIFlags, mat.globalIlluminationFlags);
                }
            });
            owner.ContainerGraph.ParentWindow.InnerWindowVariables.ExpandedRenderingOptions = value;
        }