void OnEnable() { m_WasModified = false; m_Renderer2DData = (Renderer2DData)serializedObject.targetObject; m_HDREmulationScale = serializedObject.FindProperty("m_HDREmulationScale"); m_LightBlendStyles = serializedObject.FindProperty("m_LightBlendStyles"); int numBlendStyles = m_LightBlendStyles.arraySize; m_LightBlendStylePropsArray = new LightBlendStyleProps[numBlendStyles]; for (int i = 0; i < numBlendStyles; ++i) { SerializedProperty blendStyleProp = m_LightBlendStyles.GetArrayElementAtIndex(i); ref LightBlendStyleProps props = ref m_LightBlendStylePropsArray[i]; props.enabled = blendStyleProp.FindPropertyRelative("enabled"); props.name = blendStyleProp.FindPropertyRelative("name"); props.maskTextureChannel = blendStyleProp.FindPropertyRelative("maskTextureChannel"); props.renderTextureScale = blendStyleProp.FindPropertyRelative("renderTextureScale"); props.blendMode = blendStyleProp.FindPropertyRelative("blendMode"); props.blendFactorMultiplicative = blendStyleProp.FindPropertyRelative("customBlendFactors.multiplicative"); props.blendFactorAdditive = blendStyleProp.FindPropertyRelative("customBlendFactors.additive"); if (props.blendFactorMultiplicative == null) { props.blendFactorMultiplicative = blendStyleProp.FindPropertyRelative("customBlendFactors.modulate"); } if (props.blendFactorAdditive == null) { props.blendFactorAdditive = blendStyleProp.FindPropertyRelative("customBlendFactors.additve"); } }
void OnEnable() { m_WasModified = false; m_Renderer2DData = (Renderer2DData)serializedObject.targetObject; m_TransparencySortMode = serializedObject.FindProperty("m_TransparencySortMode"); m_TransparencySortAxis = serializedObject.FindProperty("m_TransparencySortAxis"); m_HDREmulationScale = serializedObject.FindProperty("m_HDREmulationScale"); m_LightRenderTextureScale = serializedObject.FindProperty("m_LightRenderTextureScale"); m_LightBlendStyles = serializedObject.FindProperty("m_LightBlendStyles"); m_MaxLightRenderTextureCount = serializedObject.FindProperty("m_MaxLightRenderTextureCount"); m_MaxShadowRenderTextureCount = serializedObject.FindProperty("m_MaxShadowRenderTextureCount"); m_PostProcessData = serializedObject.FindProperty("m_PostProcessData"); m_CameraSortingLayersTextureBound = serializedObject.FindProperty("m_CameraSortingLayersTextureBound"); m_UseCameraSortingLayersTexture = serializedObject.FindProperty("m_UseCameraSortingLayersTexture"); m_CameraSortingLayerDownsamplingMethod = serializedObject.FindProperty("m_CameraSortingLayerDownsamplingMethod"); int numBlendStyles = m_LightBlendStyles.arraySize; m_LightBlendStylePropsArray = new LightBlendStyleProps[numBlendStyles]; for (int i = 0; i < numBlendStyles; ++i) { SerializedProperty blendStyleProp = m_LightBlendStyles.GetArrayElementAtIndex(i); ref LightBlendStyleProps props = ref m_LightBlendStylePropsArray[i]; props.name = blendStyleProp.FindPropertyRelative("name"); props.maskTextureChannel = blendStyleProp.FindPropertyRelative("maskTextureChannel"); props.blendMode = blendStyleProp.FindPropertyRelative("blendMode"); props.blendFactorMultiplicative = blendStyleProp.FindPropertyRelative("customBlendFactors.multiplicative"); props.blendFactorAdditive = blendStyleProp.FindPropertyRelative("customBlendFactors.additive"); if (props.blendFactorMultiplicative == null) { props.blendFactorMultiplicative = blendStyleProp.FindPropertyRelative("customBlendFactors.modulate"); } if (props.blendFactorAdditive == null) { props.blendFactorAdditive = blendStyleProp.FindPropertyRelative("customBlendFactors.additve"); } }