Skip to content

Commit 2533102

Browse files
committed
Added support to multiple enable properties
1 parent 31f273c commit 2533102

File tree

5 files changed

+89
-100
lines changed

5 files changed

+89
-100
lines changed

Editor/Editors/Inspectors/ShaderModuleEditor.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using UnityEditor;
22
using UnityEngine;
33
using UnityEngine.UIElements;
4-
using UnityEditor.UIElements;
54

65
namespace VRLabs.ModularShaderSystem.UI
76
{

Editor/Editors/Windows/Migrator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class MigratedShaderModule
5252
public string version;
5353
public string author;
5454
public string description;
55-
public EnableProperty enabled;
55+
public List<EnableProperty> enableProperties;
5656
public List<Property> properties;
5757
public List<string> moduleDependencies;
5858
public List<string> incompatibleWith;
@@ -312,7 +312,7 @@ private static void Import(MigratedAssets assets)
312312
module.ModuleDependencies = new List<string>(asset.moduleDependencies);
313313
module.IncompatibleWith = new List<string>(asset.incompatibleWith);
314314
module.AdditionalSerializedData = asset.additionalSerializedData;
315-
module.Enabled = asset.enabled;
315+
module.EnableProperties = new List<EnableProperty>(asset.enableProperties);
316316
module.Properties = new List<Property>(asset.properties);
317317
module.Templates = asset.templates.Select(x =>
318318
{
@@ -582,7 +582,7 @@ private void ExportSelected()
582582
version = asset.Version,
583583
author = asset.Author,
584584
description = asset.Description,
585-
enabled = asset.Enabled,
585+
enableProperties = asset.EnableProperties,
586586
properties = new List<Property>(asset.Properties),
587587
moduleDependencies = new List<string>(asset.ModuleDependencies),
588588
incompatibleWith = new List<string>(asset.IncompatibleWith),

Editor/Resources/MSS/MSSUIElements/ShaderModuleEditor.uxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<VRLabs.ModularShaderSystem.UI.InspectorList binding-path="IncompatibleWith" show-elements-text="false" />
1010

1111
<ui:Label text="Settings" style="margin-bottom: 4px; -unity-font-style: bold; margin-top: 20px;" />
12-
<uie:PropertyField binding-path="Enabled" label="Enable Property" focusable="true" />
12+
<VRLabs.ModularShaderSystem.UI.InspectorList show-elements-text="false" binding-path="EnableProperties" />
1313
<VRLabs.ModularShaderSystem.UI.InspectorList show-elements-text="false" binding-path="Properties" />
1414
<VRLabs.ModularShaderSystem.UI.InspectorList show-elements-text="false" binding-path="Functions" />
1515
<VRLabs.ModularShaderSystem.UI.InspectorList show-elements-text="false" binding-path="Templates" />

Editor/Scriptables/ShaderModule.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using UnityEngine;
34

45
namespace VRLabs.ModularShaderSystem
@@ -33,11 +34,11 @@ public class ShaderModule : ScriptableObject
3334
/// Description of the shader model.
3435
/// </summary>
3536
public string Description;
36-
37+
3738
/// <summary>
38-
/// Property used to toggle on and off the module in the generated shader.
39+
/// List of properties declared by the module.
3940
/// </summary>
40-
public EnableProperty Enabled;
41+
public List<EnableProperty> EnableProperties;
4142

4243
/// <summary>
4344
/// List of properties declared by the module.

0 commit comments

Comments
 (0)