From 21524d2bf971ab7c561c8f53bef15d2bb8951270 Mon Sep 17 00:00:00 2001 From: Alec Tutin Date: Tue, 14 Jun 2022 11:51:21 +1000 Subject: [PATCH] Fixing compass asset load in standalone builds I confirmed the previous version of the code would not work in Unity version 2021.2.18f1 - the default would end up being used instead. --- .../Runtime/ROSGeometry/GeometryCompass.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/GeometryCompass.cs b/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/GeometryCompass.cs index 24774681..1b6b83cb 100644 --- a/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/GeometryCompass.cs +++ b/com.unity.robotics.ros-tcp-connector/Runtime/ROSGeometry/GeometryCompass.cs @@ -13,7 +13,8 @@ public enum CardinalDirection public class GeometryCompass : ScriptableObject { - public const string k_CompassSettingsAsset = "GeometryCompassSettings.asset"; + public const string k_CompassSettingsName = "GeometryCompassSettings"; + public const string k_CompassSettingsAsset = k_CompassSettingsName + ".asset"; [SerializeField] CardinalDirection m_ZAxisDirection; @@ -36,7 +37,7 @@ static GeometryCompass GetOrCreateSettings() UnityEditor.AssetDatabase.SaveAssets(); } #else - s_Instance = Resources.Load(k_CompassSettingsAsset); + s_Instance = Resources.Load(k_CompassSettingsName); #endif return s_Instance; }