Skip to content

Commit

Permalink
Change LWGUI Context Menu Order
Browse files Browse the repository at this point in the history
Update RM
  • Loading branch information
JasonMa0012 committed Nov 26, 2024
1 parent ff69045 commit cd45d1c
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Editor/ScriptableObject/ShaderPropertyPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace LWGUI
{
[CreateAssetMenu(fileName = "LWGUI_ShaderPropertyPreset.asset", menuName = "LWGUI/Shader Property Preset")]
[CreateAssetMenu(fileName = "LWGUI_ShaderPropertyPreset.asset", menuName = "LWGUI/Shader Property Preset", order = 84)]
public class ShaderPropertyPreset : ScriptableObject
{
public enum PropertyType
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Having been validated through numerous large-scale commercial projects, employin
* [Custom Header and Footer](#custom-header-and-footer)
* [Custom Drawer](#custom-drawer)
* [Contribution](#contribution)
<!--te-->
<!--te-->


## Installation
Expand Down Expand Up @@ -445,6 +445,28 @@ Result:

Default display settings can be set using the LwguiGradientUsage() Attribute.


##### Gradient Editor

The new LWGUI Gradient Editor integrates with Unity's built-in [Gradient Editor](https://docs.unity3d.com/Manual/EditingValueProperties.html) and [Curve Editor](https://docs.unity3d.com/Manual/EditingCurves.html), enabling more powerful features than UE's Gradient Editor.

![image-20241126110012922](./assets/image-20241126110012922.png)

| Editor | Description |
| --------------------- | ------------------------------------------------------------ |
| Time Range | The display range of the horizontal axis, selectable from 0-1 / 0-24 / 0-2400, is very useful when the horizontal axis is time. Note that only the display is affected, the actual value stored in the horizontal axis is always 0-1. |
| Channels | The channels displayed. Can be displayed individually. |
| sRGB Preview | It should be checked when the value of Gradient is a color to preview the correct color, otherwise it doesn't need to be checked. Only affects the display, Gradient and Ramp Map are always stored as Linear. |
| Value / R / G / B / A | Used to edit the Value of the selected Key, you can edit the Value of multiple Keys at the same time. |
| Time | Used to edit the Time of the selected Key, you can edit the Time of multiple Keys at the same time. If you enter a number manually, you must **press enter** to end the editing. |
| Gradient Editor | This is similar to Unity's built-in [Gradient Editor](https://docs.unity3d.com/Manual/EditingValueProperties.html), but the Alpha channels are separated into black and white. <br/>Note that **adding keys from the Gradient Editor is limited to a maximum of 8 keys**, adding keys from the Curve Editor is **unlimited**. Exceeding the key limit will not affect preview or usage. |
| Curve Editor | Similar to Unity's built-in Curve Editor, it displays the XY 0-1 range by default, and you can use the scroll wheel to zoom or move the display range.<br/>As you can see in the image below, the context menu has a number of functions for controlling the shape of the curve, and you can consult the [Unity documentation](https://docs.unity3d.com/Manual/EditingCurves.html) to get the most out of these functions. |
| Presets | You can save the current LWGUI Gradient as a preset and apply it anytime. These presets are common between different engine versions on the local computer, but are not saved to the project. |

![image-20241126105823397](./assets/image-20241126105823397.png)![image-20241126112320151](./assets/image-20241126112320151.png)



**Known issues:**

- Preview images below Unity 2022 have no difference between sRGB/Linear color spaces
Expand Down
21 changes: 20 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
* [Custom Header and Footer](#custom-header-and-footer)
* [Custom Drawer](#custom-drawer)
* [Contribution](#contribution)
<!--te-->
<!--te-->


## Installation
Expand Down Expand Up @@ -444,6 +444,25 @@ Result:

可以使用LwguiGradientUsage() Attribute设置默认的显示设置.

##### Gradient Editor

新的LWGUI Gradient Editor集成了Unity内置的[Gradient Editor](https://docs.unity3d.com/Manual/EditingValueProperties.html)[Curve Editor](https://docs.unity3d.com/Manual/EditingCurves.html), 实现了比UE的Gradient Editor更加强大的功能.

![image-20241126110012922](./assets/image-20241126110012922.png)

| 编辑器 | 解释 |
| --------------------- | ------------------------------------------------------------ |
| Time Range | 横轴的显示范围, 可以选择0-1 / 0-24 / 0-2400, 当横轴为时间时非常有用. 注意, 只影响显示, 横轴实际存储的值始终为0-1. |
| Channels | 显示的通道, 可以单独只显示某些通道. |
| sRGB Preview | 当Gradient的值为颜色时应该勾选以预览正确的颜色, 否则不需要勾选. 只影响显示, Gradient和Ramp Map存储的值始终为Linear. |
| Value / R / G / B / A | 用于编辑已选中的Key的Value, 可以同时编辑多个Key的Value. |
| Time | 用于编辑已选中的Key的Time, 可以同时编辑多个Key的Time. 如果手动输入数字, 必须要**按回车**以结束编辑. |
| Gradient Editor | 类似于Unity内置的[Gradient Editor](https://docs.unity3d.com/Manual/EditingValueProperties.html), 但是将Alpha通道分离显示为黑白.<br/>注意, **从Gradient Editor添加Key时会受到最多8个Key的限制**, 从Curve Editor添加Key则数量**不受限制**. Key的数量超过限制不会影响预览和使用. |
| Curve Editor | 类似于Unity内置的Curve Editor, 默认显示XY 0-1的范围, 你可以用滚轮缩放或移动显示范围.<br/>如下图所示, 右键菜单中有大量控制曲线形态的功能, 你可以查阅[Unity文档](https://docs.unity3d.com/Manual/EditingCurves.html)以充分利用这些功能. |
| Presets | 你可以保存当前LWGUI Gradient为预设, 并随时调用这些预设. 这些预设在本地计算机的不同引擎版本之间通用, 但不会保存到项目中. |

![image-20241126105823397](./assets/image-20241126105823397.png)![image-20241126112320151](./assets/image-20241126112320151.png)

**已知问题:**

- Unity 2022以下的预览图像在sRGB/Linear颜色空间之间没有区别
Expand Down
Binary file added assets/image-20241126105823397.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image-20241126110012922.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/image-20241126112320151.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cd45d1c

Please sign in to comment.