mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
[unity] Fixed a potential null reference exception, potentially leading to failing drag and drop instantiation.
This commit is contained in:
parent
e54f49205c
commit
ff3492d941
@ -207,6 +207,18 @@ namespace Spine.Unity.Editor {
|
|||||||
if (File.Exists(blendMaterialPath)) {
|
if (File.Exists(blendMaterialPath)) {
|
||||||
newReplacement.material = AssetDatabase.LoadAssetAtPath<Material>(blendMaterialPath);
|
newReplacement.material = AssetDatabase.LoadAssetAtPath<Material>(blendMaterialPath);
|
||||||
} else {
|
} else {
|
||||||
|
if (materialTemplate == null) {
|
||||||
|
Debug.LogError(string.Format("Failed to create blend mode material: Material template for " +
|
||||||
|
"blend mode '{0}' was null. Re-importing might fix this issue.",
|
||||||
|
materialSuffix), originalMaterial);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (originalMaterial == null) {
|
||||||
|
Debug.LogError(string.Format("Failed to create blend mode material for atlas page '{0}': Original material for " +
|
||||||
|
"blend mode '{1}' was null. Re-importing might fix this issue.",
|
||||||
|
originalPage.name, materialSuffix));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
Material blendModeMaterial = new Material(materialTemplate) {
|
Material blendModeMaterial = new Material(materialTemplate) {
|
||||||
name = originalMaterial.name + " " + materialTemplate.name,
|
name = originalMaterial.name + " " + materialTemplate.name,
|
||||||
mainTexture = originalMaterial.mainTexture
|
mainTexture = originalMaterial.mainTexture
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.85",
|
"version": "4.2.86",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user