mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-07 11:16:53 +08:00
Look at the material's texture name instead of the material name.
This commit is contained in:
parent
c202fc5d85
commit
a2041fa9bb
@ -74,13 +74,13 @@ public class MaterialsTextureLoader : TextureLoader {
|
|||||||
String name = Path.GetFileNameWithoutExtension(path);
|
String name = Path.GetFileNameWithoutExtension(path);
|
||||||
Material material = null;
|
Material material = null;
|
||||||
foreach (Material other in atlasAsset.materials) {
|
foreach (Material other in atlasAsset.materials) {
|
||||||
if (other.name == name) {
|
if (other.mainTexture.name == name) {
|
||||||
material = other;
|
material = other;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (material == null) {
|
if (material == null) {
|
||||||
Debug.LogWarning("Material with name \"" + name + "\" not found for atlas asset: " + atlasAsset.name, atlasAsset);
|
Debug.LogWarning("Material with texture name \"" + name + "\" not found for atlas asset: " + atlasAsset.name, atlasAsset);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
page.rendererObject = material;
|
page.rendererObject = material;
|
||||||
|
|||||||
@ -79,10 +79,14 @@ public class SkeletonComponent : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Update () {
|
public virtual void Update () {
|
||||||
|
if (skeletonDataAsset == null) {
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(false);
|
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(false);
|
||||||
|
|
||||||
// Clear fields if missing information to render.
|
if (skeletonData == null) {
|
||||||
if (skeletonDataAsset == null || skeletonData == null) {
|
|
||||||
Clear();
|
Clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user