From d18d4d2063f541cb3cbb8d1136d1b1627fee339f Mon Sep 17 00:00:00 2001 From: Jason Ma <1312119064@qq.com> Date: Thu, 31 Oct 2024 16:21:23 +0800 Subject: [PATCH] Fix null reference --- Editor/OutlineNormalImporter.cs | 3 +++ Editor/SampleCustomBaker.cs | 2 +- Editor/SampleCustomImportRule.cs | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Editor/OutlineNormalImporter.cs b/Editor/OutlineNormalImporter.cs index ba1bdb2..933aa19 100644 --- a/Editor/OutlineNormalImporter.cs +++ b/Editor/OutlineNormalImporter.cs @@ -42,6 +42,9 @@ internal static List GetSharedMeshesFromGameObject(GameObject go) { List meshes = new (); + if (go == null) + return meshes; + foreach (var meshFilter in go.GetComponentsInChildren()) { meshes.Add(meshFilter.sharedMesh); diff --git a/Editor/SampleCustomBaker.cs b/Editor/SampleCustomBaker.cs index 4c01e03..6474683 100644 --- a/Editor/SampleCustomBaker.cs +++ b/Editor/SampleCustomBaker.cs @@ -1,4 +1,4 @@ -// Copyright (c) Jason Ma +// Copyright (c) Jason Ma // // Copy and modify this file to customize where outline normals are stored. diff --git a/Editor/SampleCustomImportRule.cs b/Editor/SampleCustomImportRule.cs index 1549e1f..c6240f1 100644 --- a/Editor/SampleCustomImportRule.cs +++ b/Editor/SampleCustomImportRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Jason Ma +// Copyright (c) Jason Ma // // Copy and modify this file to customize which models should bake outline normals. diff --git a/package.json b/package.json index be6d0df..6bd44c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.jasonma.outlinenormalsmoother", - "version": "1.0.0", + "version": "1.0.1", "displayName": "Outline Normal Smoother", "description": "A unity plugin that automatically calculates smooth normals for outline.", "keywords": [