mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 08:16:41 +08:00
[unity] SkeletonRenderTexture: automatically assigning RenderQuadMaterial upon component reset.
This commit is contained in:
parent
8d04c7a75b
commit
39a957c91f
@ -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);
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user