From 71c4e3659a6ee50a6a5e39c78b16abc15c08aa27 Mon Sep 17 00:00:00 2001 From: Nahuel Rocchetti Date: Mon, 5 Aug 2024 01:00:15 -0300 Subject: [PATCH 1/2] Disable batching by default --- Assets/Scripts/OpenTS2/Scenes/NeighborhoodDecorations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/OpenTS2/Scenes/NeighborhoodDecorations.cs b/Assets/Scripts/OpenTS2/Scenes/NeighborhoodDecorations.cs index 751deb3..60cbc5f 100644 --- a/Assets/Scripts/OpenTS2/Scenes/NeighborhoodDecorations.cs +++ b/Assets/Scripts/OpenTS2/Scenes/NeighborhoodDecorations.cs @@ -19,7 +19,7 @@ namespace OpenTS2.Scenes public class NeighborhoodDecorations : AssetReferenceComponent { [GameProperty(false)] - private static bool EnableBatching = true; + private static bool EnableBatching = false; private Dictionary _roadMaterialLookup = new Dictionary(); private Transform _decorationsParent; private Transform _roadsParent; From 8b5a27f0c71c2aba9c5c12d6d277a3a89d977ee6 Mon Sep 17 00:00:00 2001 From: Nahuel Rocchetti Date: Mon, 5 Aug 2024 01:18:35 -0300 Subject: [PATCH 2/2] add extension to set layers for whole hierarchy --- .../Scripts/OpenTS2/GameObjectExtensions.cs | 21 +++++++++++++++++++ .../OpenTS2/GameObjectExtensions.cs.meta | 11 ++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Assets/Scripts/OpenTS2/GameObjectExtensions.cs create mode 100644 Assets/Scripts/OpenTS2/GameObjectExtensions.cs.meta diff --git a/Assets/Scripts/OpenTS2/GameObjectExtensions.cs b/Assets/Scripts/OpenTS2/GameObjectExtensions.cs new file mode 100644 index 0000000..533b2f2 --- /dev/null +++ b/Assets/Scripts/OpenTS2/GameObjectExtensions.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace OpenTS2 +{ + public static class GameObjectExtensions + { + public static void SetLayerHierarchy(this GameObject go, int layer) + { + var transforms = go.GetComponentsInChildren(); + foreach(var transform in transforms) + { + transform.gameObject.layer = layer; + } + } + } +} diff --git a/Assets/Scripts/OpenTS2/GameObjectExtensions.cs.meta b/Assets/Scripts/OpenTS2/GameObjectExtensions.cs.meta new file mode 100644 index 0000000..3336ad5 --- /dev/null +++ b/Assets/Scripts/OpenTS2/GameObjectExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0edf7d99923e6e4e8328a1727f8271f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: