mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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();
|
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 () {
|
void CreateQuadChild () {
|
||||||
quad = new GameObject(this.name + " RenderTexture", typeof(MeshRenderer), typeof(MeshFilter));
|
quad = new GameObject(this.name + " RenderTexture", typeof(MeshRenderer), typeof(MeshFilter));
|
||||||
quad.transform.SetParent(this.transform.parent, false);
|
quad.transform.SetParent(this.transform.parent, false);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity-examples",
|
"name": "com.esotericsoftware.spine.spine-unity-examples",
|
||||||
"displayName": "spine-unity Runtime Examples",
|
"displayName": "spine-unity Runtime Examples",
|
||||||
"description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
|
"description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
|
||||||
"version": "4.1.12",
|
"version": "4.1.13",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user