浏览代码

[unity] Fixed NullReferenceException when SkeletonGraphic SkeletonDataAsset is null. Closes #2294.

Harald Csaszar 2 年之前
父节点
当前提交
72e4c2915f

+ 2 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs

@@ -307,6 +307,7 @@ namespace Spine.Unity {
 
 
 		public override void Rebuild (CanvasUpdate update) {
 		public override void Rebuild (CanvasUpdate update) {
 			base.Rebuild(update);
 			base.Rebuild(update);
+			if (!this.IsValid) return;
 			if (canvasRenderer.cull) return;
 			if (canvasRenderer.cull) return;
 			if (update == CanvasUpdate.PreRender) {
 			if (update == CanvasUpdate.PreRender) {
 				if (requiresInstructionUpate) PrepareInstructionsAndRenderers(isInRebuild: true);
 				if (requiresInstructionUpate) PrepareInstructionsAndRenderers(isInRebuild: true);
@@ -401,6 +402,7 @@ namespace Spine.Unity {
 		}
 		}
 
 
 		public void LateUpdate () {
 		public void LateUpdate () {
+			if (!this.IsValid) return;
 			// instantiation can happen from Update() after this component, leading to a missing Update() call.
 			// instantiation can happen from Update() after this component, leading to a missing Update() call.
 			if (!wasUpdatedAfterInit) Update(0);
 			if (!wasUpdatedAfterInit) Update(0);
 			if (freeze) return;
 			if (freeze) return;

+ 1 - 1
spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json

@@ -2,7 +2,7 @@
   "name": "com.esotericsoftware.spine.urp-shaders",
   "name": "com.esotericsoftware.spine.urp-shaders",
   "displayName": "Spine Universal RP Shaders",
   "displayName": "Spine Universal RP Shaders",
   "description": "This plugin provides universal render pipeline (URP) shaders for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
   "description": "This plugin provides universal render pipeline (URP) shaders for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-  "version": "4.1.12",
+  "version": "4.1.13",
   "unity": "2019.3",
   "unity": "2019.3",
   "author": {
   "author": {
     "name": "Esoteric Software",
     "name": "Esoteric Software",