[unity] SkeletonRenderTexture: automatically assigning RenderQuadMaterial upon component reset.

This commit is contained in:
Harald Csaszar 2023-07-19 11:37:19 +02:00
parent 8d04c7a75b
commit 39a957c91f
2 changed files with 12 additions and 1 deletions

View File

@ -73,6 +73,17 @@ namespace Spine.Unity.Examples {
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);

View File

@ -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",