The source shader that want to change from.
The destination shader that want to change to.
- The list on the left shows all the properties in the source shader.
- The list in the middle shows all the properties want to convert to, None means the property will not be converted.
- The list on the right shows the type of the property.
⚠️ If the property type is None, the property will not be converted even if the destination is not None.
Click this button to change the shader and convert properties. This option will scan the whole project folder.
Click this button to change the shader and convert properties. If there are materials selected, only the chosen materials will be changed. Otherwise nothing will be changed.
Namescpace: EditorTools.ShaderPropertiesConverter
public enum PropertyType
A enum that contain the type of the property.
Name | Description | Value |
---|---|---|
None | ||
Texture | ||
Float | ||
Vector | ||
Color |
Namescpace: EditorTools.ShaderPropertiesConverter
public class PropertyData
This class is used to store the data of shader properties.
Name | Declaration | Description | Type |
---|---|---|---|
source | public string source{ get; set; } |
represents the name of source shader property | string |
dest | public string dest { get; set ; } = "None"; |
represents the name of destination shader property | string |
type | public PropertyType type{ get; set; } |
represents the type of shader property | PropertyType |
Namescpace: EditorTools.ShaderPropertiesConverter
public class ShaderPropertiesConverter
This class is used to convert shader properties from one shader to another.
Upgrade all materials in the project folder.
UpgradeProjectFolder(List<PropertyData> properties, string oldShader, string newShader)
Name | Description | Type |
---|---|---|
properties | List of properties to be converted | List<PropertyData> |
oldShader | Old shader name | string |
newShader | New shader name | string |
Upgrade all materials in the selection
UpgradeSelection(UnityEngine.Object[] selection, List<PropertyData> properties, string oldShader, string newShader)
Name | Description | Type |
---|---|---|
selection | List of objects to be converted | UnityEngine.Object[] |
properties | List of properties to be converted | List<PropertyData> |
oldShader | Old shader name | string |
newShader | New shader name | string |