Skip to content

Commit 7b9f34c

Browse files
committed
Update RM
1 parent 651c406 commit 7b9f34c

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

.obsidian/workspace.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@
108108
"state": {
109109
"type": "outline",
110110
"state": {
111-
"file": "README_CN.md",
111+
"file": "README.md",
112112
"followCursor": false,
113113
"showSearch": false,
114114
"searchQuery": ""
115115
},
116116
"icon": "lucide-list",
117-
"title": "Outline of README_CN"
117+
"title": "Outline of README"
118118
}
119119
}
120120
]
@@ -208,11 +208,11 @@
208208
"obsidian-git:Open Git source control": false
209209
}
210210
},
211-
"active": "1ab61776fdab9c7c",
211+
"active": "d93ffc2d4e7b14bd",
212212
"lastOpenFiles": [
213-
"package.json~",
214-
"README.md",
215213
"README_CN.md",
214+
"README.md",
215+
"package.json~",
216216
"Editor/ScriptableObject.meta",
217217
"Editor/ScriptableObject/LwguiShaderPropertyPreset.cs.meta",
218218
"Editor/ScriptableObject/LwguiRampAtlas.cs.meta",
@@ -222,7 +222,6 @@
222222
"Editor/ScriptableObject/GradientObject.cs",
223223
"Editor/ScriptableObject",
224224
"Editor/ScriptableObject/LWGUIShaderPropertyPreset.cs",
225-
"Editor/ScriptableObject/LWGUIRampAtlas.cs.meta",
226225
"assets~/Pasted image 20250523120309.png",
227226
"assets~/Pasted image 20250522183200.png",
228227
"assets~/Pasted image 20250321174432.png",

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LWGUI (Light Weight Shader GUI)
1+
# LWGUI (Light Weight Shader GUI)
22

33
[中文](https://github.com/JasonMa0012/LWGUI/blob/dev/README_CN.md) | [English](https://github.com/JasonMa0012/LWGUI)
44

@@ -1039,6 +1039,18 @@ MaterialToggleUIDrawer(string keyword)
10391039

10401040

10411041

1042+
## FAQs
1043+
1044+
### Problems Occurred After Modifying the Material in the Code
1045+
1046+
After modifying material properties in the code, the Drawer logic ***does not*** run, potentially losing some data (e.g., Keywords).
1047+
You need to manually call `LWGUI.UnityEditorExtension.ApplyMaterialPropertyAndDecoratorDrawers()` to set up this part of the data (it will actually call `MaterialPropertyDrawer.Apply()`).
1048+
1049+
### Problems Occurred After Creating the Material in the Code
1050+
1051+
When creating materials in code, some Drawer logic may ***not*** run, and default values might not meet expectations.
1052+
You need to manually call `LWGUI.PresetHelper.ApplyPresetsInMaterial()` to ensure default values are correct.
1053+
10421054
## Custom Shader GUI
10431055

10441056
### Custom Header and Footer

README_CN.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LWGUI (Light Weight Shader GUI)
1+
# LWGUI (Light Weight Shader GUI)
22

33
[中文](https://github.com/JasonMa0012/LWGUI/blob/dev/README_CN.md) | [English](https://github.com/JasonMa0012/LWGUI)
44

@@ -1031,6 +1031,17 @@ MaterialToggleUIDrawer(string keyword)
10311031
```
10321032

10331033

1034+
## FAQs
1035+
1036+
### 在代码中修改材质后出现问题
1037+
1038+
在代码中修改材质属性后, Drawer逻辑不会运行, 可能会丢失一些数据 (例如Keywords).
1039+
你需要手动调用`LWGUI.UnityEditorExtension.ApplyMaterialPropertyAndDecoratorDrawers()`以设置这部分数据 (实际上会调用`MaterialPropertyDrawer.Apply()`).
1040+
1041+
### 在代码中创建材质后出现问题
1042+
1043+
在代码中创建材质时部分Drawer逻辑不会运行, 默认值可能不符合预期.
1044+
你需要手动调用`LWGUI.PresetHelper.ApplyPresetsInMaterial()`以确保默认值正确.
10341045

10351046
## Custom Shader GUI
10361047

0 commit comments

Comments
 (0)