private void InstallShaderExtensionGUI() { if (!ExtensionManager.IsShaderExtensionAvailable(BlendModeEffect.ShaderFamily)) { EditorGUILayout.HelpBox(string.Format("`{0}` shader family is not available.", BlendModeEffect.ShaderFamily), MessageType.Warning); EditorGUILayout.HelpBox("You can add your own shader extensions; see `Adding shader extensions` in the docs for more info.", MessageType.Info); return; } EditorGUILayout.HelpBox(string.Format("`{0}` shader extension is available, but not installed.", BlendModeEffect.ShaderFamily), MessageType.Info); if (GUILayout.Button("Install shader extension")) { ExtensionManager.InstallShaderExtension(BlendModeEffect.ShaderFamily); BlendModeEffect.InitializeComponentExtension(); } }
private void InstallComponentExtensionGUI() { if (!ExtensionManager.IsObjectContainsSupportedComponent(BlendModeEffect.gameObject)) { EditorGUILayout.HelpBox(string.Format("`{0}` game object doesn't have a supported component.", BlendModeEffect.gameObject.name), MessageType.Warning); EditorGUILayout.HelpBox("You can add your own component extensions; see `Adding component extensions` in the docs for more info.", MessageType.Info); return; } var extendedType = ExtensionManager.GetSupportedComponentOnObject(BlendModeEffect.gameObject).GetType().FullName; EditorGUILayout.HelpBox(string.Format("Component extension for `{0}` is available, but not installed.", extendedType), MessageType.Info); if (GUILayout.Button("Install component extension")) { ExtensionManager.InstallComponentExtension(extendedType); BlendModeEffect.InitializeComponentExtension(); } }
private void OnEnable() { shaderFamilyProperty = serializedObject.FindProperty("shaderFamily"); blendModeProperty = serializedObject.FindProperty("blendMode"); renderModeProperty = serializedObject.FindProperty("renderMode"); overlayColorProperty = serializedObject.FindProperty("overlayColor"); overlayTextureProperty = serializedObject.FindProperty("overlayTexture"); overlayTextureOffsetProperty = serializedObject.FindProperty("overlayTextureOffset"); overlayTextureScaleProperty = serializedObject.FindProperty("overlayTextureScale"); maskModeProperty = serializedObject.FindProperty("maskMode"); maskBehaviourProperty = serializedObject.FindProperty("maskBehaviour"); framebufferEnabledProperty = serializedObject.FindProperty("framebufferEnabled"); unifiedGrabEnabledProperty = serializedObject.FindProperty("unifiedGrabEnabled"); shareMaterialProperty = serializedObject.FindProperty("shareMaterial"); componentExtensionProperty = serializedObject.FindProperty("componentExtension"); componentExtensionEditor = CreateEditor(componentExtensionProperty.objectReferenceValue); BlendModeEffect.InitializeComponentExtension(); }
private void OnEnable() { if (BlendModeEffect) { BlendModeEffect.InitializeComponentExtension(); var shaderPropertiesProperty = serializedObject.FindProperty("componentExtensionState").FindPropertyRelative("shaderProperties"); shaderPropertiesList = new ShaderPropertiesList(serializedObject, shaderPropertiesProperty, BlendModeEffect.GetComponentExtension <ComponentExtension>()); } shaderFamilyProperty = serializedObject.FindProperty("shaderFamily"); blendModeProperty = serializedObject.FindProperty("blendMode"); renderModeProperty = serializedObject.FindProperty("renderMode"); overlayColorProperty = serializedObject.FindProperty("overlayColor"); overlayTextureProperty = serializedObject.FindProperty("overlayTexture"); overlayTextureOffsetProperty = serializedObject.FindProperty("overlayTextureOffset"); overlayTextureScaleProperty = serializedObject.FindProperty("overlayTextureScale"); maskModeProperty = serializedObject.FindProperty("maskMode"); maskBehaviourProperty = serializedObject.FindProperty("maskBehaviour"); framebufferEnabledProperty = serializedObject.FindProperty("framebufferEnabled"); unifiedGrabEnabledProperty = serializedObject.FindProperty("unifiedGrabEnabled"); shareMaterialProperty = serializedObject.FindProperty("shareMaterial"); }