8000 Fixed possible NRE with the mesh object's sharedMesh by StephenHodgson · Pull Request #25 · XRTK/com.xrtk.wmr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Fixed possible NRE with the mesh object's sharedMesh #25

Merged
merged 1 commit into from
May 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using XRTK.Providers.SpatialObservers;
using XRTK.WindowsMixedReality.Profiles;

#if UNITY_WSA
using System;
using UnityEngine;
using UnityEngine.XR.WSA;
using XRTK.Definitions.SpatialAwarenessSystem;
Expand Down Expand Up @@ -189,7 +189,14 @@ void OnDataReady(SurfaceData cookedData, bool outputWritten, float elapsedCookTi
// Recalculate the mesh normals if requested.
if (MeshRecalculateNormals)
{
meshObject.Filter.sharedMesh.RecalculateNormals();
if (meshObject.Filter.sharedMesh != null)
{
meshObject.Filter.sharedMesh.RecalculateNormals();
}
else
{
meshObject.Filter.mesh.RecalculateNormals();
}
}

meshObject.GameObject.SetActive(true);
Expand Down
0