mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +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);
|
||||
Material material = null;
|
||||
foreach (Material other in atlasAsset.materials) {
|
||||
if (other.name == name) {
|
||||
if (other.mainTexture.name == name) {
|
||||
material = other;
|
||||
break;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
page.rendererObject = material;
|
||||
|
||||
@ -79,10 +79,14 @@ public class SkeletonComponent : MonoBehaviour {
|
||||
}
|
||||
|
||||
public virtual void Update () {
|
||||
if (skeletonDataAsset == null) {
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(false);
|
||||
|
||||
// Clear fields if missing information to render.
|
||||
if (skeletonDataAsset == null || skeletonData == null) {
|
||||
if (skeletonData == null) {
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user