Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/connffuused/formerlyserializedasforshaderlab
[FormerlySerializedAs] attribute for ShaderLab in Unity.
https://github.com/connffuused/formerlyserializedasforshaderlab
formerlyserializedas property rename shader shaderlab unity unity3d utility
Last synced: about 2 months ago
JSON representation
[FormerlySerializedAs] attribute for ShaderLab in Unity.
- Host: GitHub
- URL: https://github.com/connffuused/formerlyserializedasforshaderlab
- Owner: connffuused
- License: mit
- Created: 2021-09-04T11:31:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-30T01:11:06.000Z (about 3 years ago)
- Last Synced: 2024-11-09T06:45:25.896Z (3 months ago)
- Topics: formerlyserializedas, property, rename, shader, shaderlab, unity, unity3d, utility
- Language: C#
- Homepage:
- Size: 24.4 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# FormerlySerializedAs For ShaderLab
blog post : https://seonghwan.tistory.com/122## Features
### [FormerlySerializedAs()] for shader
This attribute in shader file will be a rule to re-serialize your materials that uses the shader. It will read the values from the filesystem in `*.mat`, and put the values at the property of the new name.
#### Example
```shaderlab
Shader "Custom/UI/Default"
{
Properties
{
[FormerlySerializedAs(_PrevValue)] _ChangedValue ("Changed Value", Float) = 0
...
}
...
}
```![image](https://user-images.githubusercontent.com/79823287/132132555-04eb2577-7073-47ba-b4b3-840fe26e8bd9.png)
`[FormerlySerializedAs(OLD_NAME)]` property can specify what you want to re-serialize the materials on postprocess timing from the callback ' `AssetPostprocessor`'. This works likes [FormerlySerializedAs](https://docs.unity3d.com/ScriptReference/Serialization.FormerlySerializedAsAttribute.html) in MonoScript API.
## TODO
- Replacement tool
- Clean up unused property against binded shader.## Install
### hosted by npm.js
```json
{
"dependencies": {
"kr.seonghwan.shader-almighty": "0.0.3"
}
}
``````json
{
"scopedRegistries": [
{
"name": "npm-seonghwan",
"url": "https://registry.npmjs.org",
"scopes": [
"kr.seonghwan",
"aaubry"
]
}
]
}
```## Dependencies
- [YAML dotnet](https://github.com/aaubry/YamlDotNet) from [Antoine Aubry](https://github.com/aaubry)