Skip to content

Commit

Permalink
[unity] SkeletonRenderTexture: automatically assigning RenderQuadMate…
Browse files Browse the repository at this point in the history
…rial upon component reset.
  • Loading branch information
HaraldCsaszar committed Jul 19, 2023
1 parent 8d04c7a commit 39a957c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Expand Up @@ -73,6 +73,17 @@ public class SkeletonRenderTexture : SkeletonRenderTextureBase {
CreateQuadChild();
}

#if UNITY_EDITOR
protected void Reset () {
string[] folders = { "Assets", "Packages" };
string[] assets = UnityEditor.AssetDatabase.FindAssets("t:material RenderQuadMaterial", folders);
if (assets.Length > 0) {
string materialPath = UnityEditor.AssetDatabase.GUIDToAssetPath(assets[0]);
quadMaterial = UnityEditor.AssetDatabase.LoadAssetAtPath<Material>(materialPath);
}
}
#endif

void CreateQuadChild () {
quad = new GameObject(this.name + " RenderTexture", typeof(MeshRenderer), typeof(MeshFilter));
quad.transform.SetParent(this.transform.parent, false);
Expand Down
2 changes: 1 addition & 1 deletion spine-unity/Assets/Spine Examples/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity-examples",
"displayName": "spine-unity Runtime Examples",
"description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
"version": "4.1.12",
"version": "4.1.13",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",
Expand Down

0 comments on commit 39a957c

Please sign in to comment.