Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ShopCart v1.4.16
ShopCart.dll
Decompiled a month agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using REPOLib.Modules; using TMPro; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ShopCartMod { internal sealed class ShopCartMarker : MonoBehaviour { private ValueScreen _screen; private TextMeshPro _display; private TextMeshPro[] _displays; private int _total; private int _count; private int _lastRenderedCurrency = int.MinValue; private int _lastRenderedTotal = int.MinValue; private int _lastRenderedCount = int.MinValue; private string _renderedText; private Color _renderedColor; private Transform _model; private static readonly HashSet<PhysGrabObject> ContainedItems = new HashSet<PhysGrabObject>(); private static readonly Collider[] BasketOverlaps = (Collider[])(object)new Collider[256]; private static ShopCartMarker _instance; private static readonly FieldInfo ShopItemField = AccessTools.Field(typeof(ItemAttributes), "shopItem"); private static readonly FieldInfo InStartRoomField = AccessTools.Field(typeof(ItemAttributes), "inStartRoom"); private static readonly FieldInfo ItemValueField = AccessTools.Field(typeof(ItemAttributes), "value"); private static readonly FieldInfo ItemsInCartField = AccessTools.Field(typeof(PhysGrabCart), "itemsInCart"); private static readonly FieldInfo CartPhysicalField = AccessTools.Field(typeof(PhysGrabCart), "physGrabObject"); private static readonly FieldInfo ItemsInCartCountField = AccessTools.Field(typeof(PhysGrabCart), "itemsInCartCount"); private static readonly FieldInfo HaulCurrentField = AccessTools.Field(typeof(PhysGrabCart), "haulCurrent"); private static readonly Color Affordable = new Color(0.35f, 1f, 0.48f); private static readonly Color TooExpensive = new Color(1f, 0.24f, 0.18f); private static readonly Color Empty = new Color(0.55f, 0.86f, 1f); private void Start() { PhysGrabCart component = ((Component)this).GetComponent<PhysGrabCart>(); _screen = (((Object)(object)component != (Object)null) ? component.valueScreen : ((Component)this).GetComponentInChildren<ValueScreen>(true)); _display = (((Object)(object)_screen != (Object)null) ? _screen.displayText : ((Component)this).GetComponentInChildren<TextMeshPro>(true)); Transform val = (_model = ((Component)this).transform.Find("SHOPPING C.A.R.T. Model")); _displays = (TextMeshPro[])(((Object)(object)val != (Object)null) ? ((Array)((Component)val).GetComponentsInChildren<TextMeshPro>(true)) : ((Array)new TextMeshPro[1] { _display })); _instance = this; ContainedItems.Clear(); ItemAttributes component2 = ((Component)this).GetComponent<ItemAttributes>(); if ((Object)(object)component2 != (Object)null) { ShopItemField?.SetValue(component2, false); InStartRoomField?.SetValue(component2, false); component2.DisableUI(false); } } internal void RefreshFromCart(PhysGrabCart cart) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cart == (Object)null) { return; } int num = 0; int num2 = 0; HashSet<PhysGrabObject> hashSet = new HashSet<PhysGrabObject>(); HashSet<PhysGrabObject> hashSet2 = new HashSet<PhysGrabObject>(); List<PhysGrabObject> list = ItemsInCartField?.GetValue(cart) as List<PhysGrabObject>; object? obj = CartPhysicalField?.GetValue(cart); PhysGrabObject val = (PhysGrabObject)((obj is PhysGrabObject) ? obj : null); if (list == null) { return; } foreach (PhysGrabObject item in list) { if ((Object)(object)item != (Object)null) { hashSet.Add(item); } } if ((Object)(object)_model != (Object)null) { Vector3 lossyScale = _model.lossyScale; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0.7f * Mathf.Abs(lossyScale.x), 0.48f * Mathf.Abs(lossyScale.y), 0.76f * Mathf.Abs(lossyScale.z)); int num3 = Physics.OverlapBoxNonAlloc(_model.TransformPoint(new Vector3(0f, 0.94f, 0.02f)), val2, BasketOverlaps, _model.rotation, -1, (QueryTriggerInteraction)1); for (int i = 0; i < num3; i++) { Collider val3 = BasketOverlaps[i]; BasketOverlaps[i] = null; PhysGrabObject val4 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponentInParent<PhysGrabObject>() : null); if ((Object)(object)val4 != (Object)null) { hashSet.Add(val4); } } } list.Clear(); foreach (PhysGrabObject item2 in hashSet) { if ((Object)(object)item2 != (Object)null && (Object)(object)item2 != (Object)(object)val && IsInsideBasket(item2)) { list.Add(item2); } } ContainedItems.Clear(); foreach (PhysGrabObject item3 in list) { if (!((Object)(object)item3 == (Object)null) && !((Object)(object)item3 == (Object)(object)val) && hashSet2.Add(item3)) { ItemAttributes val5 = ((Component)item3).GetComponent<ItemAttributes>(); if ((Object)(object)val5 == (Object)null) { val5 = ((Component)item3).GetComponentInChildren<ItemAttributes>(true); } if (!((Object)(object)val5 == (Object)null) && !(ShopItemField == null) && (bool)ShopItemField.GetValue(val5)) { num += Mathf.Max(0, (ItemValueField != null) ? ((int)ItemValueField.GetValue(val5)) : 0); num2++; ContainedItems.Add(item3); } } } bool num4 = num != _total; _total = num; _count = num2; ItemsInCartCountField?.SetValue(cart, num2); HaulCurrentField?.SetValue(cart, num); if (num4) { ValueScreen screen = _screen; if (screen != null) { screen.UpdateValue(num); } } } private bool IsInsideBasket(PhysGrabObject physical) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_model == (Object)null || (Object)(object)physical == (Object)null) { return false; } Collider[] componentsInChildren = ((Component)physical).GetComponentsInChildren<Collider>(true); Vector3 val3 = default(Vector3); foreach (Collider val in componentsInChildren) { if ((Object)(object)val == (Object)null || !val.enabled || val.isTrigger) { continue; } Transform model = _model; Bounds bounds = val.bounds; Vector3 val2 = model.InverseTransformPoint(((Bounds)(ref bounds)).center); ((Vector3)(ref val3))..ctor(Mathf.Clamp(val2.x, -0.6f, 0.6f), Mathf.Clamp(val2.y, 0.5f, 1.36f), Mathf.Clamp(val2.z, -0.63f, 0.67f)); Vector3 val4 = _model.InverseTransformPoint(val.ClosestPoint(_model.TransformPoint(val3))); if (!(val4.y < 0.48f) && !(val4.y > 1.4f)) { float num = Mathf.Clamp01((val4.y - 0.46f) / 0.7f); float num2 = Mathf.Lerp(0.53f, 0.64f, num) + 0.05f; float num3 = Mathf.Lerp(-0.57f, -0.67f, num) - 0.05f; float num4 = Mathf.Lerp(0.5f, 0.71f, num) + 0.05f; if (Mathf.Abs(val4.x) <= num2 && val4.z >= num3 && val4.z <= num4) { return true; } } } return false; } internal static bool Contains(PhysGrabObject physical) { if ((Object)(object)physical != (Object)null) { if (!ContainedItems.Contains(physical)) { if ((Object)(object)_instance != (Object)null) { return _instance.IsInsideBasket(physical); } return false; } return true; } return false; } private void OnDestroy() { ContainedItems.Clear(); if ((Object)(object)_instance == (Object)(object)this) { _instance = null; } } private void LateUpdate() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_display == (Object)null || !SemiFunc.RunIsShop()) { return; } int num = SemiFunc.StatGetRunCurrency(); if (num != _lastRenderedCurrency || _total != _lastRenderedTotal || _count != _lastRenderedCount) { _lastRenderedCurrency = num; _lastRenderedTotal = _total; _lastRenderedCount = _count; long num2 = (long)num - (long)_total; bool flag = num2 >= 0; _renderedColor = ((_count == 0) ? Empty : (flag ? Affordable : TooExpensive)); string text = ((_count == 0) ? "#8CD9FF" : (flag ? "#59FF7A" : "#FF3D2E")); string text2 = ((_count == 0) ? "EMPTY" : ((!flag) ? ("OVER $" + SemiFunc.DollarGetString((int)Math.Min(2147483647L, -num2)) + "K") : ("LEFT $" + SemiFunc.DollarGetString((int)Math.Min(2147483647L, num2)) + "K"))); _renderedText = "<color=" + text + ">$" + SemiFunc.DollarGetString(_total) + "K\n<size=62%>" + _count + " ITEMS | " + text2 + "</size></color>"; } if (string.IsNullOrEmpty(_renderedText)) { return; } TextMeshPro[] displays = _displays; foreach (TextMeshPro val in displays) { if (!((Object)(object)val == (Object)null)) { if (((Graphic)val).color != _renderedColor) { ((Graphic)val).color = _renderedColor; } if (((TMP_Text)val).text != _renderedText) { ((TMP_Text)val).text = _renderedText; } } } } } [BepInPlugin("uz.cherdak.repo.shopcart", "Shop Cart", "1.4.16")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class ShopCartPlugin : BaseUnityPlugin { internal static ManualLogSource Log; private const string NetworkPrefabName = "SosoTeam Shop Cart"; internal const string DisplayName = "SHOPPING C.A.R.T."; private PrefabRef _cartPrefab; private float _nextPrepareAttempt; private float _shopSpawnAt; private float _nextSpawnAttempt; private bool _wasInShop; private GameObject _spawnedCart; private static readonly FieldInfo ShopItemField = AccessTools.Field(typeof(ItemAttributes), "shopItem"); private static readonly FieldInfo InStartRoomField = AccessTools.Field(typeof(ItemAttributes), "inStartRoom"); private void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; new Harmony("uz.cherdak.repo.shopcart").PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Shop Cart 1.4.16 loaded"); } private void Update() { bool flag = SemiFunc.RunIsShop(); if (flag && !_wasInShop) { _shopSpawnAt = Time.unscaledTime + 2.5f; } _wasInShop = flag; if ((_cartPrefab == null || !((PrefabRef<GameObject>)(object)_cartPrefab).IsValid()) && Time.unscaledTime >= _nextPrepareAttempt) { _nextPrepareAttempt = Time.unscaledTime + 2f; TryPrepareCartPrefab(); } if (flag && !(Time.unscaledTime < _shopSpawnAt) && _cartPrefab != null && ((PrefabRef<GameObject>)(object)_cartPrefab).IsValid() && SemiFunc.IsMasterClientOrSingleplayer() && !((Object)(object)_spawnedCart != (Object)null) && !(Time.unscaledTime < _nextSpawnAttempt) && !((Object)(object)Object.FindObjectOfType<ShopCartMarker>() != (Object)null)) { SpawnCart(); } } private void TryPrepareCartPrefab() { if (NetworkPrefabs.TryGetNetworkPrefabRef("SosoTeam Shop Cart", ref _cartPrefab)) { return; } PhysGrabCart val = FindBestCartSource(); if ((Object)(object)val == (Object)null) { return; } GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject); ((Object)val2).name = "SosoTeam Shop Cart"; val2.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val2); ItemAttributes component = val2.GetComponent<ItemAttributes>(); if ((Object)(object)component != (Object)null) { ShopItemField?.SetValue(component, false); InStartRoomField?.SetValue(component, false); component.DisableUI(false); if ((Object)(object)component.item != (Object)null) { Item val3 = Object.Instantiate<Item>(component.item); ((Object)val3).name = "SHOPPING C.A.R.T."; val3.itemName = "SHOPPING C.A.R.T."; val3.itemNameLocalized = null; component.item = val3; } } ShoppingCartVisuals.Build(val2, val2.GetComponent<PhysGrabCart>()); if ((Object)(object)val2.GetComponent<ShopCartMarker>() == (Object)null) { val2.AddComponent<ShopCartMarker>(); } _cartPrefab = NetworkPrefabs.RegisterNetworkPrefab("SosoTeam Shop Cart", val2); if (_cartPrefab != null && ((PrefabRef<GameObject>)(object)_cartPrefab).IsValid()) { Log.LogInfo((object)("Prepared the permanent shop cart from " + ((Object)((Component)val).gameObject).name + ".")); } } private static PhysGrabCart FindBestCartSource() { //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) List<PhysGrabCart> list = new List<PhysGrabCart>(); AddItemCart(Resources.Load<Item>("Items/Item Cart Medium"), list); foreach (Item item in Items.AllItems.Where((Item item) => (Object)(object)item != (Object)null)) { AddItemCart(item, list); } Item[] array = Resources.LoadAll<Item>("ScriptableObjects"); for (int num = 0; num < array.Length; num++) { AddItemCart(array[num], list); } if ((Object)(object)StatsManager.instance != (Object)null && StatsManager.instance.itemDictionary != null) { foreach (Item value in StatsManager.instance.itemDictionary.Values) { AddItemCart(value, list); } } PhysGrabCart[] array2 = Resources.FindObjectsOfTypeAll<PhysGrabCart>(); foreach (PhysGrabCart val in array2) { if ((Object)(object)val != (Object)null && !list.Contains(val)) { list.Add(val); } } PhysGrabCart result = null; int num2 = int.MinValue; foreach (PhysGrabCart item2 in list) { if (!((Object)(object)item2 == (Object)null) && !((Object)(object)((Component)item2).GetComponent<ShopCartMarker>() != (Object)null)) { string obj = ((Object)((Component)item2).gameObject).name ?? string.Empty; int num3 = 0; if (!item2.isSmallCart) { num3 += 100; } if (obj.IndexOf("cart", StringComparison.OrdinalIgnoreCase) >= 0) { num3 += 20; } if (obj.IndexOf("medium", StringComparison.OrdinalIgnoreCase) >= 0) { num3 += 250; } if (obj.IndexOf("big", StringComparison.OrdinalIgnoreCase) >= 0) { num3 += 100; } if (obj.IndexOf("small", StringComparison.OrdinalIgnoreCase) >= 0) { num3 -= 150; } if (obj.IndexOf("cannon", StringComparison.OrdinalIgnoreCase) >= 0) { num3 -= 500; } if (obj.IndexOf("laser", StringComparison.OrdinalIgnoreCase) >= 0) { num3 -= 500; } if ((Object)(object)item2.valueScreen != (Object)null) { num3 += 30; } if ((Object)(object)((Component)item2).GetComponent<PhysGrabObject>() != (Object)null) { num3 += 20; } Scene scene = ((Component)item2).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { num3 -= 5; } if (num3 > num2) { result = item2; num2 = num3; } } } return result; } private static void AddItemCart(Item item, List<PhysGrabCart> candidates) { if (!((Object)(object)item == (Object)null) && item.prefab != null && !((Object)(object)((PrefabRef<GameObject>)(object)item.prefab).Prefab == (Object)null) && ((item.itemName ?? string.Empty) + " " + (((Object)item).name ?? string.Empty)).IndexOf("cart", StringComparison.OrdinalIgnoreCase) >= 0) { PhysGrabCart component = ((PrefabRef<GameObject>)(object)item.prefab).Prefab.GetComponent<PhysGrabCart>(); if ((Object)(object)component != (Object)null && !candidates.Contains(component)) { candidates.Add(component); } } } private void SpawnCart() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)ShopManager.instance != (Object)null) ? ShopManager.instance.extractionPoint : null); Vector3 val2 = Vector3.zero; Quaternion val3 = Quaternion.identity; bool flag = false; float groundY = 0f; if ((Object)(object)val != (Object)null) { val3 = Quaternion.Euler(0f, val.eulerAngles.y + 180f, 0f); Vector3[] array = (Vector3[])(object)new Vector3[6] { -val.forward * 3.2f + val.right * 2.4f, -val.forward * 3.2f - val.right * 2.4f, -val.forward * 4.4f + val.right * 1.4f, -val.forward * 4.4f - val.right * 1.4f, val.forward * 2.8f + val.right * 2.3f, val.forward * 2.8f - val.right * 2.3f }; foreach (Vector3 val4 in array) { Vector3 val5 = val.position + val4; if (TryFindShopFloor(val5, val.position.y, out groundY) && HasCartClearance(val5, groundY, val3)) { val2 = val5; flag = true; break; } } } if (!flag && (Object)(object)PlayerAvatar.instance != (Object)null) { Transform transform = ((Component)PlayerAvatar.instance).transform; val3 = Quaternion.Euler(0f, transform.eulerAngles.y, 0f); Vector3[] array = (Vector3[])(object)new Vector3[4] { transform.forward * 2.6f + transform.right * 1.8f, transform.forward * 2.6f - transform.right * 1.8f, -transform.forward * 2.4f + transform.right * 1.8f, -transform.forward * 2.4f - transform.right * 1.8f }; foreach (Vector3 val6 in array) { Vector3 val7 = transform.position + val6; if (TryFindShopFloor(val7, transform.position.y, out groundY) && HasCartClearance(val7, groundY, val3)) { val2 = val7; flag = true; break; } } } if (!flag) { _nextSpawnAttempt = Time.unscaledTime + 1.5f; Log.LogWarning((object)"No clear shop-floor position is currently available for the shop cart; retrying."); return; } val2.y = groundY + 0.65f; GameObject val8 = NetworkPrefabs.SpawnNetworkPrefab(_cartPrefab, val2, val3, (byte)0, (object[])null); if ((Object)(object)val8 != (Object)null) { if (!val8.activeSelf) { val8.SetActive(true); } if ((Object)(object)val8.GetComponent<ShopCartMarker>() == (Object)null) { val8.AddComponent<ShopCartMarker>(); } _spawnedCart = val8; Log.LogInfo((object)("Spawned the shop cart in a clear space on verified floor Y=" + groundY.ToString("F2") + ".")); } } private static bool HasCartClearance(Vector3 position, float groundY, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapBox(new Vector3(position.x, groundY + 0.82f, position.z), new Vector3(0.82f, 0.68f, 0.94f), rotation, -1, (QueryTriggerInteraction)1); foreach (Collider val in array) { if (!((Object)(object)val == (Object)null) && val.enabled) { Bounds bounds = val.bounds; if (!(((Bounds)(ref bounds)).max.y <= groundY + 0.14f)) { return false; } } } return true; } private static bool TryFindShopFloor(Vector3 position, float referenceY, out float groundY) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) groundY = 0f; RaycastHit[] array = Physics.RaycastAll(new Vector3(position.x, referenceY + 4f, position.z), Vector3.down, 8f, -1, (QueryTriggerInteraction)1); bool flag = false; float num = float.MaxValue; RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (!((Object)(object)((RaycastHit)(ref val)).collider == (Object)null) && !((RaycastHit)(ref val)).collider.isTrigger && !(((RaycastHit)(ref val)).normal.y < 0.65f) && !(((RaycastHit)(ref val)).point.y < referenceY - 2.5f) && !(((RaycastHit)(ref val)).point.y > referenceY + 0.45f) && !(((RaycastHit)(ref val)).point.y >= num)) { num = ((RaycastHit)(ref val)).point.y; flag = true; } } if (flag) { groundY = num; } return flag; } } [HarmonyPatch(typeof(ItemAttributes), "ShopInTruckLogic")] internal static class KeepCartOutOfShoppingListPatch { private static bool Prefix(ItemAttributes __instance) { if (!((Object)(object)__instance == (Object)null)) { return (Object)(object)((Component)__instance).GetComponent<ShopCartMarker>() == (Object)null; } return true; } } [HarmonyPatch(typeof(PhysGrabCart), "ObjectsInCart")] internal static class ShopCartPricePatch { private static void Postfix(PhysGrabCart __instance) { ShopCartMarker shopCartMarker = (((Object)(object)__instance != (Object)null) ? ((Component)__instance).GetComponent<ShopCartMarker>() : null); if ((Object)(object)shopCartMarker != (Object)null) { shopCartMarker.RefreshFromCart(__instance); } } } [HarmonyPatch(typeof(PhysGrabCart), "Start")] internal static class ShopCartNativePhysicsBindingPatch { private static readonly FieldInfo SupportsField = AccessTools.Field(typeof(PhysGrabCart), "capsuleColliders"); private static readonly FieldInfo BasketField = AccessTools.Field(typeof(PhysGrabCart), "cartInside"); private static readonly FieldInfo ContentsField = AccessTools.Field(typeof(PhysGrabCart), "inCart"); private static void Postfix(PhysGrabCart __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).GetComponent<ShopCartMarker>() == (Object)null) { return; } Transform val = ((Component)__instance).transform.Find("SHOPPING C.A.R.T. Model"); if ((Object)(object)val == (Object)null) { return; } List<Collider> list = SupportsField?.GetValue(__instance) as List<Collider>; List<Collider> list2 = BasketField?.GetValue(__instance) as List<Collider>; list?.Clear(); list2?.Clear(); Collider[] componentsInChildren = ((Component)val).GetComponentsInChildren<Collider>(true); foreach (Collider val2 in componentsInChildren) { if (!((Object)(object)val2 == (Object)null) && !val2.isTrigger && val2.enabled) { if (((Object)((Component)val2).gameObject).name == "Smooth Caster Hover Collider") { list?.Add(val2); } else if (((Object)((Component)val2).gameObject).name.StartsWith("Basket ", StringComparison.Ordinal)) { list2?.Add(val2); } } } Transform val3 = val.Find("Shopping Cart Exact Contents Trigger"); if ((Object)(object)val3 != (Object)null) { ContentsField?.SetValue(__instance, val3); } ManualLogSource log = ShopCartPlugin.Log; if (log != null) { log.LogInfo((object)("Native cart physics bound to " + (list?.Count ?? 0) + " real supports and " + (list2?.Count ?? 0) + " basket colliders.")); } } } internal static class ShopCartMeleeGuard { private static readonly FieldInfo PhysicalField = AccessTools.Field(typeof(ItemMelee), "physGrabObject"); private static readonly FieldInfo HurtTransformField = AccessTools.Field(typeof(ItemMelee), "hurtColliderTransform"); private static readonly FieldInfo HitBoxTimerField = AccessTools.Field(typeof(ItemMelee), "hitBoxTimer"); private static readonly FieldInfo NewSwingField = AccessTools.Field(typeof(ItemMelee), "newSwing"); private static readonly FieldInfo SwingParticlesField = AccessTools.Field(typeof(ItemMelee), "particleSystemSwing"); internal static bool Allow(ItemMelee melee) { if ((Object)(object)melee == (Object)null) { return true; } object? obj = PhysicalField?.GetValue(melee); PhysGrabObject val = (PhysGrabObject)((obj is PhysGrabObject) ? obj : null); if ((Object)(object)val == (Object)null || val.grabbed || !ShopCartMarker.Contains(val)) { return true; } object? obj2 = HurtTransformField?.GetValue(melee); Transform val2 = (Transform)((obj2 is Transform) ? obj2 : null); if ((Object)(object)val2 != (Object)null && ((Component)val2).gameObject.activeSelf) { ((Component)val2).gameObject.SetActive(false); } HitBoxTimerField?.SetValue(melee, 0f); NewSwingField?.SetValue(melee, false); object? obj3 = SwingParticlesField?.GetValue(melee); ParticleSystem val3 = (ParticleSystem)((obj3 is ParticleSystem) ? obj3 : null); if ((Object)(object)val3 != (Object)null && val3.isPlaying) { val3.Stop(); } return false; } } [HarmonyPatch(typeof(ItemMelee), "Update")] internal static class FreezeContainedMeleeUpdatePatch { private static bool Prefix(ItemMelee __instance) { return ShopCartMeleeGuard.Allow(__instance); } } [HarmonyPatch(typeof(ItemMelee), "FixedUpdate")] internal static class FreezeContainedMeleeFixedUpdatePatch { private static bool Prefix(ItemMelee __instance) { return ShopCartMeleeGuard.Allow(__instance); } } [HarmonyPatch(typeof(ItemMelee), "SwingDetectionLogic")] internal static class PreventCartMotionMeleeSwingPatch { private static bool Prefix(ItemMelee __instance) { return ShopCartMeleeGuard.Allow(__instance); } } [HarmonyPatch(typeof(ItemMelee), "ActivateHitbox")] internal static class PreventCartMotionMeleeHitboxPatch { private static bool Prefix(ItemMelee __instance) { return ShopCartMeleeGuard.Allow(__instance); } } [HarmonyPatch(typeof(WorldSpaceUIValue), "Show", new Type[] { typeof(PhysGrabObject), typeof(int), typeof(bool), typeof(Vector3) })] internal static class HideShopCartHoverPricePatch { private static bool Prefix(PhysGrabObject __0) { if (!((Object)(object)__0 == (Object)null)) { return (Object)(object)((Component)__0).GetComponent<ShopCartMarker>() == (Object)null; } return true; } } internal sealed class ShoppingCartUndercarriagePassThrough : MonoBehaviour { private Collider[] _supports; private Collider[] _basketShell; private PhysGrabObject _owner; private float _nextScan; private readonly Collider[] _nearby = (Collider[])(object)new Collider[48]; private readonly HashSet<int> _supportsIgnored = new HashSet<int>(); private readonly Dictionary<PhysGrabObject, float> _belowItems = new Dictionary<PhysGrabObject, float>(); private readonly List<PhysGrabObject> _restoreBuffer = new List<PhysGrabObject>(); internal void Configure(Collider[] supports) { _supports = supports; } internal void AddSupports(Collider[] supports) { if (supports != null && supports.Length != 0) { _supports = ((_supports == null) ? supports : _supports.Concat(supports).ToArray()); } } private void Start() { _owner = ((Component)this).GetComponentInParent<PhysGrabObject>(); _basketShell = (from collider in ((Component)this).GetComponentsInChildren<Collider>(true) where (Object)(object)collider != (Object)null && ((Object)((Component)collider).gameObject).name.StartsWith("Basket ", StringComparison.Ordinal) select collider).ToArray(); } private void FixedUpdate() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_supports == null || Time.fixedTime < _nextScan) { return; } _nextScan = Time.fixedTime + 0.04f; int num = LayerMask.NameToLayer("PhysGrabObject"); int num2 = ((num >= 0) ? (1 << num) : (-1)); int num3 = Physics.OverlapBoxNonAlloc(((Component)this).transform.TransformPoint(new Vector3(0f, 0.2f, 0.01f)), new Vector3(0.76f, 0.26f, 0.78f), _nearby, ((Component)this).transform.rotation, num2, (QueryTriggerInteraction)1); for (int i = 0; i < num3; i++) { Collider candidate = _nearby[i]; _nearby[i] = null; ProcessNearbyItem(candidate); } _restoreBuffer.Clear(); foreach (KeyValuePair<PhysGrabObject, float> belowItem in _belowItems) { if ((Object)(object)belowItem.Key == (Object)null || Time.fixedTime - belowItem.Value > 0.16f) { _restoreBuffer.Add(belowItem.Key); } } foreach (PhysGrabObject item in _restoreBuffer) { RestoreBasketCollision(item); } } private void OnTriggerEnter(Collider other) { ProcessNearbyItem(other); } private void OnTriggerStay(Collider other) { ProcessNearbyItem(other); } private void ProcessNearbyItem(Collider candidate) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)candidate == (Object)null || _supports == null) { return; } PhysGrabObject componentInParent = ((Component)candidate).GetComponentInParent<PhysGrabObject>(); if (!IsRealItem(componentInParent)) { return; } Collider[] componentsInChildren = ((Component)componentInParent).GetComponentsInChildren<Collider>(true); if (_supportsIgnored.Add(((Object)componentInParent).GetInstanceID())) { SetCollisionState(_supports, componentsInChildren, ignore: true); } Rigidbody component = ((Component)componentInParent).GetComponent<Rigidbody>(); Vector3 val; if (!((Object)(object)component != (Object)null)) { Bounds bounds = candidate.bounds; val = ((Bounds)(ref bounds)).center; } else { val = component.worldCenterOfMass; } Vector3 val2 = val; if (!(((Component)this).transform.InverseTransformPoint(val2).y < 0.43f)) { RestoreBasketCollision(componentInParent); return; } if (!_belowItems.ContainsKey(componentInParent)) { SetCollisionState(_basketShell, componentsInChildren, ignore: true); } _belowItems[componentInParent] = Time.fixedTime; } private bool IsRealItem(PhysGrabObject physical) { if ((Object)(object)physical == (Object)null || (Object)(object)physical == (Object)(object)_owner || (Object)(object)((Component)physical).GetComponent<PhysGrabCart>() != (Object)null) { return false; } ItemAttributes val = ((Component)physical).GetComponent<ItemAttributes>(); if ((Object)(object)val == (Object)null) { val = ((Component)physical).GetComponentInChildren<ItemAttributes>(true); } return (Object)(object)val != (Object)null; } private void RestoreBasketCollision(PhysGrabObject physical) { if ((Object)(object)physical == (Object)null) { _belowItems.Remove(physical); } else if (_belowItems.Remove(physical)) { SetCollisionState(_basketShell, ((Component)physical).GetComponentsInChildren<Collider>(true), ignore: false); } } private static void SetCollisionState(Collider[] cartColliders, Collider[] itemColliders, bool ignore) { if (cartColliders == null || itemColliders == null) { return; } foreach (Collider val in cartColliders) { foreach (Collider val2 in itemColliders) { if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null) { Physics.IgnoreCollision(val, val2, ignore); } } } } } internal static class ShoppingCartVisuals { private static Material _metal; private static Material _darkMetal; private static Material _rubber; private static Material _handle; private static Material _screen; private static Material _hoverBlue; private static Material _hoverGlow; private static PhysicMaterial _smoothPhysics; private static PhysicMaterial _basketPhysics; private static readonly FieldInfo CartGrabPointField = AccessTools.Field(typeof(PhysGrabCart), "cartGrabPoint"); private static readonly FieldInfo HandlePointField = AccessTools.Field(typeof(PhysGrabCart), "handlePoint"); private static readonly FieldInfo InCartField = AccessTools.Field(typeof(PhysGrabCart), "inCart"); private static readonly FieldInfo GrabAreasField = AccessTools.Field(typeof(PhysGrabObjectGrabArea), "grabAreas"); internal static void Build(GameObject prefab, PhysGrabCart cart) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)prefab == (Object)null) && !((Object)(object)cart == (Object)null) && !((Object)(object)prefab.transform.Find("SHOPPING C.A.R.T. Model") != (Object)null)) { EnsureMaterials((from renderer in prefab.GetComponentsInChildren<Renderer>(true) select renderer.sharedMaterial).FirstOrDefault((Func<Material, bool>)((Material material) => (Object)(object)material != (Object)null))); Renderer[] componentsInChildren = prefab.GetComponentsInChildren<Renderer>(true); for (int num = 0; num < componentsInChildren.Length; num++) { componentsInChildren[num].enabled = false; } float num2 = FindPhysicalFloor(prefab); DisableOriginalSolidColliders(prefab); DisableOriginalCartTriggers(prefab); Transform transform = new GameObject("SHOPPING C.A.R.T. Model").transform; transform.SetParent(prefab.transform, false); transform.localPosition = new Vector3(0f, num2, 0f); BuildBasket(transform); BuildFrame(transform); BuildWheels(transform); BuildDashboard(transform, cart); AddBasketColliders(transform); AddWheelColliders(transform); AddLowerRimGrabColliders(transform); ConfigureCartContentsTrigger(transform, cart); ConfigureHandle(prefab, transform, cart); Rigidbody component = prefab.GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.collisionDetectionMode = (CollisionDetectionMode)2; } } } private static void BuildBasket(Transform root) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) Rod("Top Left", root, new Vector3(-0.64f, 1.16f, -0.67f), new Vector3(-0.64f, 1.16f, 0.71f), 0.024f, _metal); Rod("Top Right", root, new Vector3(0.64f, 1.16f, -0.67f), new Vector3(0.64f, 1.16f, 0.71f), 0.024f, _metal); Rod("Top Front", root, new Vector3(-0.64f, 1.16f, 0.71f), new Vector3(0.64f, 1.16f, 0.71f), 0.024f, _metal); Rod("Top Rear", root, new Vector3(-0.64f, 1.16f, -0.67f), new Vector3(0.64f, 1.16f, -0.67f), 0.024f, _metal); Rod("Bottom Left", root, new Vector3(-0.53f, 0.46f, -0.57f), new Vector3(-0.53f, 0.46f, 0.5f), 0.023f, _metal); Rod("Bottom Right", root, new Vector3(0.53f, 0.46f, -0.57f), new Vector3(0.53f, 0.46f, 0.5f), 0.023f, _metal); Rod("Bottom Front", root, new Vector3(-0.53f, 0.46f, 0.5f), new Vector3(0.53f, 0.46f, 0.5f), 0.023f, _metal); Rod("Bottom Rear", root, new Vector3(-0.53f, 0.46f, -0.57f), new Vector3(0.53f, 0.46f, -0.57f), 0.023f, _metal); for (int i = 0; i <= 11; i++) { float num = (float)i / 11f; float num2 = Mathf.Lerp(-0.57f, 0.5f, num); float num3 = Mathf.Lerp(-0.67f, 0.71f, num); Rod("Left Vertical " + i, root, new Vector3(-0.53f, 0.46f, num2), new Vector3(-0.64f, 1.16f, num3), 0.011f, _metal); Rod("Right Vertical " + i, root, new Vector3(0.53f, 0.46f, num2), new Vector3(0.64f, 1.16f, num3), 0.011f, _metal); } for (int j = 0; j <= 10; j++) { float num4 = (float)j / 10f; float num5 = Mathf.Lerp(-0.53f, 0.53f, num4); float num6 = Mathf.Lerp(-0.64f, 0.64f, num4); Rod("Front Vertical " + j, root, new Vector3(num5, 0.46f, 0.5f), new Vector3(num6, 1.16f, 0.71f), 0.011f, _metal); Rod("Rear Vertical " + j, root, new Vector3(num5, 0.46f, -0.57f), new Vector3(num6, 1.16f, -0.67f), 0.011f, _metal); } for (int k = 1; k <= 6; k++) { float num7 = (float)k / 7f; float num8 = Mathf.Lerp(0.46f, 1.16f, num7); float num9 = Mathf.Lerp(0.53f, 0.64f, num7); float num10 = Mathf.Lerp(-0.57f, -0.67f, num7); float num11 = Mathf.Lerp(0.5f, 0.71f, num7); Rod("Left Horizontal " + k, root, new Vector3(0f - num9, num8, num10), new Vector3(0f - num9, num8, num11), 0.011f, _metal); Rod("Right Horizontal " + k, root, new Vector3(num9, num8, num10), new Vector3(num9, num8, num11), 0.011f, _metal); Rod("Front Horizontal " + k, root, new Vector3(0f - num9, num8, num11), new Vector3(num9, num8, num11), 0.011f, _metal); Rod("Rear Horizontal " + k, root, new Vector3(0f - num9, num8, num10), new Vector3(num9, num8, num10), 0.011f, _metal); } for (int l = 0; l <= 10; l++) { float num12 = Mathf.Lerp(-0.53f, 0.53f, (float)l / 10f); Rod("Floor Long " + l, root, new Vector3(num12, 0.46f, -0.57f), new Vector3(num12, 0.46f, 0.5f), 0.011f, _metal); } for (int m = 0; m <= 10; m++) { float num13 = Mathf.Lerp(-0.57f, 0.5f, (float)m / 10f); Rod("Floor Cross " + m, root, new Vector3(-0.53f, 0.46f, num13), new Vector3(0.53f, 0.46f, num13), 0.011f, _metal); } Part("Child Seat", (PrimitiveType)3, root, new Vector3(0f, 0.94f, -0.6f), new Vector3(0.84f, 0.26f, 0.025f), new Vector3(-8f, 0f, 0f), _handle); } private static void BuildFrame(Transform root) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) Rail("Left Upper Frame", root, new Vector3(-0.48f, 0.4f, 0.02f), new Vector3(0.06f, 0.12f, 1.18f)); Rail("Right Upper Frame", root, new Vector3(0.48f, 0.4f, 0.02f), new Vector3(0.06f, 0.12f, 1.18f)); Rail("Left Leg", root, new Vector3(-0.43f, 0.31f, -0.36f), new Vector3(0.055f, 0.3f, 0.055f)); Rail("Right Leg", root, new Vector3(0.43f, 0.31f, -0.36f), new Vector3(0.055f, 0.3f, 0.055f)); Rail("Front Axle", root, new Vector3(0f, 0.25f, 0.52f), new Vector3(1.02f, 0.055f, 0.055f)); Rail("Rear Axle", root, new Vector3(0f, 0.25f, -0.5f), new Vector3(1.02f, 0.055f, 0.055f)); Rod("Handle Left Support", root, new Vector3(-0.6f, 1.03f, -0.67f), new Vector3(-0.6f, 1.23f, -0.91f), 0.035f, _metal); Rod("Handle Right Support", root, new Vector3(0.6f, 1.03f, -0.67f), new Vector3(0.6f, 1.23f, -0.91f), 0.035f, _metal); Rod("Red Push Handle", root, new Vector3(-0.7f, 1.23f, -0.91f), new Vector3(0.7f, 1.23f, -0.91f), 0.065f, _handle); } private static void BuildWheels(Transform root) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[2] { -0.48f, 0.48f }; float[] array2 = new float[2] { -0.5f, 0.52f }; float[] array3 = array; foreach (float num in array3) { float[] array4 = array2; foreach (float num2 in array4) { Part("Caster Mounting Plate", (PrimitiveType)3, root, new Vector3(num, 0.285f, num2), new Vector3(0.25f, 0.025f, 0.2f), Vector3.zero, _metal); Part("Caster Swivel Bearing", (PrimitiveType)2, root, new Vector3(num, 0.255f, num2), new Vector3(0.085f, 0.035f, 0.085f), Vector3.zero, _metal); Part("Caster Stem", (PrimitiveType)2, root, new Vector3(num, 0.215f, num2), new Vector3(0.035f, 0.045f, 0.035f), Vector3.zero, _metal); Part("Caster Fork Crown", (PrimitiveType)3, root, new Vector3(num, 0.185f, num2), new Vector3(0.25f, 0.045f, 0.075f), Vector3.zero, _metal); Part("Caster Fork Left", (PrimitiveType)3, root, new Vector3(num - 0.105f, 0.135f, num2), new Vector3(0.035f, 0.13f, 0.06f), new Vector3(-10f, 0f, 0f), _metal); Part("Caster Fork Right", (PrimitiveType)3, root, new Vector3(num + 0.105f, 0.135f, num2), new Vector3(0.035f, 0.13f, 0.06f), new Vector3(-10f, 0f, 0f), _metal); Part("Caster Rubber Tire", (PrimitiveType)2, root, new Vector3(num, 0.11f, num2 + 0.012f), new Vector3(0.105f, 0.075f, 0.105f), new Vector3(0f, 0f, 90f), _rubber); Part("Wheel Hub Left", (PrimitiveType)2, root, new Vector3(num - 0.079f, 0.11f, num2 + 0.012f), new Vector3(0.052f, 0.012f, 0.052f), new Vector3(0f, 0f, 90f), _metal); Part("Wheel Hub Right", (PrimitiveType)2, root, new Vector3(num + 0.079f, 0.11f, num2 + 0.012f), new Vector3(0.052f, 0.012f, 0.052f), new Vector3(0f, 0f, 90f), _metal); Rod("Wheel Axle", root, new Vector3(num - 0.125f, 0.11f, num2 + 0.012f), new Vector3(num + 0.125f, 0.11f, num2 + 0.012f), 0.012f, _darkMetal); } } } private static void BuildDashboard(Transform root, PhysGrabCart cart) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) Part("Rear Dashboard Housing", (PrimitiveType)3, root, new Vector3(0f, 0.99f, -0.705f), new Vector3(0.82f, 0.3f, 0.1f), Vector3.zero, _darkMetal); Part("Rear Dashboard Face", (PrimitiveType)3, root, new Vector3(0f, 0.99f, -0.762f), new Vector3(0.74f, 0.25f, 0.018f), Vector3.zero, _screen); Part("Front Dashboard Housing", (PrimitiveType)3, root, new Vector3(0f, 0.99f, 0.745f), new Vector3(0.82f, 0.3f, 0.1f), Vector3.zero, _darkMetal); Part("Front Dashboard Face", (PrimitiveType)3, root, new Vector3(0f, 0.99f, 0.802f), new Vector3(0.74f, 0.25f, 0.018f), Vector3.zero, _screen); if (!((Object)(object)cart.valueScreen == (Object)null)) { TextMeshPro val = cart.valueScreen.displayText; if ((Object)(object)val == (Object)null) { val = new GameObject("Cart Total Display", new Type[2] { typeof(RectTransform), typeof(TextMeshPro) }).GetComponent<TextMeshPro>(); } ((Object)((Component)val).gameObject).name = "Cart Total Display"; val.transform.SetParent(root, false); val.transform.localPosition = new Vector3(0f, 0.99f, -0.775f); val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; ((Component)val).gameObject.SetActive(true); ((Behaviour)val).enabled = true; Renderer component = ((Component)val).GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { component.enabled = true; } ((TMP_Text)val).alignment = (TextAlignmentOptions)514; ((TMP_Text)val).fontSize = 1.8f; ((TMP_Text)val).enableAutoSizing = true; ((TMP_Text)val).fontSizeMin = 0.35f; ((TMP_Text)val).fontSizeMax = 1.8f; ((TMP_Text)val).rectTransform.sizeDelta = new Vector2(0.7f, 0.23f); ((Graphic)val).color = Color.white; ((TMP_Text)val).text = "$0K\n0 ITEMS | EMPTY"; cart.valueScreen.displayText = val; TextMeshPro component2 = Object.Instantiate<GameObject>(((Component)val).gameObject, root).GetComponent<TextMeshPro>(); ((Object)((Component)component2).gameObject).name = "Front Cart Total Display"; component2.transform.localPosition = new Vector3(0f, 0.99f, 0.815f); component2.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); component2.transform.localScale = Vector3.one; ((Component)component2).gameObject.SetActive(true); ((Behaviour)component2).enabled = true; Renderer component3 = ((Component)component2).GetComponent<Renderer>(); if ((Object)(object)component3 != (Object)null) { component3.enabled = true; } } } private static void AddBasketColliders(Transform root) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) PassiveBox("Basket Floor Ray Pass", root, new Vector3(0f, 0.445f, -0.035f), new Vector3(1.16f, 0.045f, 1.18f)); PassiveBox("Basket Lower Left Ray Pass", root, new Vector3(-0.55f, 0.61f, 0.02f), new Vector3(0.15f, 0.36f, 1.28f)); PassiveBox("Basket Lower Right Ray Pass", root, new Vector3(0.55f, 0.61f, 0.02f), new Vector3(0.15f, 0.36f, 1.28f)); PassiveBox("Basket Lower Front Ray Pass", root, new Vector3(0f, 0.61f, 0.55f), new Vector3(1.18f, 0.36f, 0.2f)); PassiveBox("Basket Lower Rear Ray Pass", root, new Vector3(0f, 0.61f, -0.59f), new Vector3(1.18f, 0.36f, 0.18f)); PassiveBox("Basket Upper Left Ray Pass", root, new Vector3(-0.61f, 0.98f, 0.02f), new Vector3(0.16f, 0.42f, 1.44f)); PassiveBox("Basket Upper Right Ray Pass", root, new Vector3(0.61f, 0.98f, 0.02f), new Vector3(0.16f, 0.42f, 1.44f)); PassiveBox("Basket Upper Front Ray Pass", root, new Vector3(0f, 0.98f, 0.67f), new Vector3(1.3f, 0.42f, 0.2f)); PassiveBox("Basket Upper Rear Ray Pass", root, new Vector3(0f, 0.98f, -0.65f), new Vector3(1.3f, 0.42f, 0.18f)); } private static void AddWheelColliders(Transform root) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) List<Collider> list = new List<Collider>(); float[] array = new float[2] { -0.48f, 0.48f }; float[] array2 = new float[2] { -0.5f, 0.52f }; float[] array3 = array; foreach (float num in array3) { float[] array4 = array2; foreach (float num2 in array4) { list.Add((Collider)(object)PassiveSphere("Smooth Caster Hover Collider", root, new Vector3(num, 0.12f, num2 + 0.012f), 0.12f)); } } ((Component)root).gameObject.AddComponent<ShoppingCartUndercarriagePassThrough>().Configure(list.ToArray()); BoxCollider obj = ((Component)root).gameObject.AddComponent<BoxCollider>(); obj.center = new Vector3(0f, 0.18f, 0.01f); obj.size = new Vector3(1.38f, 0.4f, 1.42f); ((Collider)obj).isTrigger = true; } private static void AddLowerRimGrabColliders(Transform root) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) Collider[] supports = (Collider[])(object)new Collider[4] { (Collider)ColliderBox("Lower Left Rim Grab", root, new Vector3(-0.53f, 0.405f, -0.035f), new Vector3(0.11f, 0.1f, 1.12f)), (Collider)ColliderBox("Lower Right Rim Grab", root, new Vector3(0.53f, 0.405f, -0.035f), new Vector3(0.11f, 0.1f, 1.12f)), (Collider)ColliderBox("Lower Front Rim Grab", root, new Vector3(0f, 0.405f, 0.5f), new Vector3(1.06f, 0.1f, 0.1f)), (Collider)ColliderBox("Lower Rear Rim Grab", root, new Vector3(0f, 0.405f, -0.57f), new Vector3(1.06f, 0.1f, 0.1f)) }; ShoppingCartUndercarriagePassThrough component = ((Component)root).GetComponent<ShoppingCartUndercarriagePassThrough>(); if ((Object)(object)component != (Object)null) { component.AddSupports(supports); } } private static void ConfigureCartContentsTrigger(Transform root, PhysGrabCart cart) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Shopping Cart Exact Contents Trigger"); val.transform.SetParent(root, false); val.transform.localPosition = new Vector3(0f, 0.82f, 0.015f); val.transform.localScale = new Vector3(1.02f, 0.64f, 1.04f); val.layer = 0; val.tag = "Cart"; BoxCollider obj = val.AddComponent<BoxCollider>(); ((Collider)obj).isTrigger = true; obj.size = Vector3.one; InCartField?.SetValue(cart, val.transform); } private static void Rail(string name, Transform root, Vector3 position, Vector3 scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) AxisRod(name, root, position, scale, _metal); } private static void Wire(string name, Transform root, Vector3 position, Vector3 scale) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) AxisRod(name, root, position, scale, _metal); } private static void AxisRod(string name, Transform root, Vector3 position, Vector3 size, Material material) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) Vector3 val; float num; float num2; if (size.x >= size.y && size.x >= size.z) { val = Vector3.right; num = size.x; num2 = Mathf.Max(size.y, size.z); } else if (size.y >= size.z) { val = Vector3.up; num = size.y; num2 = Mathf.Max(size.x, size.z); } else { val = Vector3.forward; num = size.z; num2 = Mathf.Max(size.x, size.y); } Rod(name, root, position - val * num * 0.5f, position + val * num * 0.5f, num2 * 0.5f, material); } private static GameObject Rod(string name, Transform parent, Vector3 start, Vector3 end, float radius, Material material) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = end - start; GameObject obj = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)obj).name = name; obj.transform.SetParent(parent, false); obj.transform.localPosition = (start + end) * 0.5f; obj.transform.localRotation = Quaternion.FromToRotation(Vector3.up, ((Vector3)(ref val)).normalized); obj.transform.localScale = new Vector3(radius * 2f, ((Vector3)(ref val)).magnitude * 0.5f, radius * 2f); Renderer component = obj.GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { component.sharedMaterial = material; } Collider component2 = obj.GetComponent<Collider>(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } return obj; } private static float FindPhysicalFloor(GameObject prefab) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) float num = 0f; bool flag = false; Collider[] componentsInChildren = prefab.GetComponentsInChildren<Collider>(true); foreach (Collider val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !val.isTrigger && val.enabled) { Transform transform = prefab.transform; Bounds bounds = val.bounds; float x = ((Bounds)(ref bounds)).center.x; bounds = val.bounds; float y = ((Bounds)(ref bounds)).min.y; bounds = val.bounds; Vector3 val2 = transform.InverseTransformPoint(new Vector3(x, y, ((Bounds)(ref bounds)).center.z)); if (!flag || val2.y < num) { num = val2.y; flag = true; } } } if (!flag) { return -0.48f; } return num + 0.01f; } private static void ConfigureHandle(GameObject prefab, Transform root, PhysGrabCart cart) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Shopping Cart Handle Grab Point"); val.transform.SetParent(root, false); val.transform.localPosition = new Vector3(0f, 1.23f, -0.91f); Transform transform = val.transform; CartGrabPointField?.SetValue(cart, transform); HandlePointField?.SetValue(cart, transform); GameObject val2 = new GameObject("Red Handle Physical Grab Collider"); val2.transform.SetParent(root, false); val2.transform.localPosition = transform.localPosition; val2.layer = LayerMask.NameToLayer("PhysGrabObject"); val2.tag = "Phys Grab Object"; val2.AddComponent<BoxCollider>().size = new Vector3(1.5f, 0.18f, 0.2f); val2.AddComponent<PhysGrabObjectCollider>(); PhysGrabObjectGrabArea component = prefab.GetComponent<PhysGrabObjectGrabArea>(); IList list = (((Object)(object)component != (Object)null) ? (GrabAreasField?.GetValue(component) as IList) : null); if (list == null) { return; } GameObject val3 = new GameObject("Red Handle Steering Area"); val3.transform.SetParent(root, false); val3.transform.localPosition = transform.localPosition; BoxCollider obj = val3.AddComponent<BoxCollider>(); ((Collider)obj).isTrigger = true; obj.size = new Vector3(1.72f, 0.58f, 0.78f); Type nestedType = typeof(PhysGrabObjectGrabArea).GetNestedType("GrabArea", BindingFlags.Public | BindingFlags.NonPublic); if (nestedType == null) { return; } object obj2 = ((list.Count > 0) ? list[0] : null); object obj3 = Activator.CreateInstance(nestedType); if (obj2 != null) { string[] array = new string[3] { "grabAreaEventOnStart", "grabAreaEventOnRelease", "grabAreaEventOnHolding" }; foreach (string text in array) { FieldInfo fieldInfo = AccessTools.Field(nestedType, text); if (fieldInfo != null) { fieldInfo.SetValue(obj3, fieldInfo.GetValue(obj2)); } } } AccessTools.Field(nestedType, "grabAreaTransform")?.SetValue(obj3, val3.transform); list.Clear(); list.Add(obj3); } private static void DisableOriginalSolidColliders(GameObject prefab) { Collider[] componentsInChildren = prefab.GetComponentsInChildren<Collider>(true); foreach (Collider val in componentsInChildren) { if ((Object)(object)val != (Object)null && !val.isTrigger) { val.enabled = false; } } } private static void DisableOriginalCartTriggers(GameObject prefab) { Collider[] componentsInChildren = prefab.GetComponentsInChildren<Collider>(true); foreach (Collider val in componentsInChildren) { if ((Object)(object)val != (Object)null && val.isTrigger && ((Component)val).CompareTag("Cart")) { val.enabled = false; } } } private static GameObject Part(string name, PrimitiveType primitive, Transform parent, Vector3 position, Vector3 scale, Vector3 rotation, Material material) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive(primitive); ((Object)obj).name = name; obj.transform.SetParent(parent, false); obj.transform.localPosition = position; obj.transform.localScale = scale; obj.transform.localRotation = Quaternion.Euler(rotation); Renderer component = obj.GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { component.sharedMaterial = material; } Collider component2 = obj.GetComponent<Collider>(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } return obj; } private static BoxCollider ColliderBox(string name, Transform parent, Vector3 center, Vector3 size) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = center; val.layer = LayerMask.NameToLayer("PhysGrabObject"); val.tag = "Phys Grab Object"; BoxCollider obj = val.AddComponent<BoxCollider>(); obj.size = size; val.AddComponent<PhysGrabObjectCollider>(); return obj; } private static GameObject PassiveColliderObject(string name, Transform parent, Vector3 center) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = center; val.layer = 0; return val; } private static GameObject SupportColliderObject(string name, Transform parent, Vector3 center) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localPosition = center; int num = LayerMask.NameToLayer("PhysGrabObject"); val.layer = ((num >= 0) ? num : 0); return val; } private static void PassiveBox(string name, Transform parent, Vector3 center, Vector3 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) BoxCollider obj = PassiveColliderObject(name, parent, center).AddComponent<BoxCollider>(); obj.size = size; ((Collider)obj).material = BasketPhysics(); } private static PhysicMaterial BasketPhysics() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if ((Object)(object)_basketPhysics != (Object)null) { return _basketPhysics; } _basketPhysics = new PhysicMaterial("SHOPPING C.A.R.T. Slick Basket") { dynamicFriction = 0f, staticFriction = 0f, bounciness = 0f, frictionCombine = (PhysicMaterialCombine)2, bounceCombine = (PhysicMaterialCombine)2 }; Object.DontDestroyOnLoad((Object)(object)_basketPhysics); return _basketPhysics; } private static SphereCollider PassiveSphere(string name, Transform parent, Vector3 center, float radius) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) SphereCollider obj = SupportColliderObject(name, parent, center).AddComponent<SphereCollider>(); obj.radius = radius; ((Collider)obj).material = SmoothPhysics(); return obj; } private static void PassiveCapsule(string name, Transform parent, Vector3 center, float radius, float height) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider obj = SupportColliderObject(name, parent, center).AddComponent<CapsuleCollider>(); obj.direction = 2; obj.radius = radius; obj.height = height; ((Collider)obj).material = SmoothPhysics(); } private static PhysicMaterial SmoothPhysics() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if ((Object)(object)_smoothPhysics != (Object)null) { return _smoothPhysics; } _smoothPhysics = new PhysicMaterial("SHOPPING C.A.R.T. Smooth Underside") { dynamicFriction = 0.14f, staticFriction = 0.18f, bounciness = 0f, frictionCombine = (PhysicMaterialCombine)2, bounceCombine = (PhysicMaterialCombine)2 }; Object.DontDestroyOnLoad((Object)(object)_smoothPhysics); return _smoothPhysics; } private static void EnsureMaterials(Material fallback) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_metal != (Object)null)) { Shader val = Shader.Find("Standard") ?? Shader.Find("Universal Render Pipeline/Lit"); if ((Object)(object)val == (Object)null && (Object)(object)fallback != (Object)null) { val = fallback.shader; } if ((Object)(object)val == (Object)null) { throw new InvalidOperationException("No compatible cart shader was found."); } _metal = Material(val, "Polished Silver Chrome", new Color(0.8f, 0.83f, 0.87f), 0.66f, 0.99f); _darkMetal = Material(val, "Brushed Silver Chrome", new Color(0.69f, 0.72f, 0.76f), 0.62f, 0.94f); _rubber = Material(val, "Caster Rubber", new Color(0.018f, 0.021f, 0.024f), 0.05f, 0.18f); _handle = Material(val, "Handle Red", new Color(0.72f, 0.045f, 0.025f), 0.08f, 0.28f); _screen = Material(val, "Price Screen", new Color(0.012f, 0.025f, 0.055f), 0.1f, 0.52f); _hoverBlue = Material(val, "Hoverboard Blue", new Color(0.025f, 0.16f, 0.48f), 0.72f, 0.95f); _hoverGlow = Material(val, "Hoverboard Cyan Glow", new Color(0.02f, 0.42f, 1f), 0.18f, 0.92f); if (_screen.HasProperty("_EmissionColor")) { _screen.EnableKeyword("_EMISSION"); _screen.SetColor("_EmissionColor", new Color(0.01f, 0.035f, 0.11f)); } if (_metal.HasProperty("_EmissionColor")) { _metal.EnableKeyword("_EMISSION"); _metal.SetColor("_EmissionColor", new Color(0.025f, 0.028f, 0.034f)); } if (_darkMetal.HasProperty("_EmissionColor")) { _darkMetal.EnableKeyword("_EMISSION"); _darkMetal.SetColor("_EmissionColor", new Color(0.018f, 0.02f, 0.025f)); } if (_hoverBlue.HasProperty("_EmissionColor")) { _hoverBlue.EnableKeyword("_EMISSION"); _hoverBlue.SetColor("_EmissionColor", new Color(0.015f, 0.1f, 0.42f)); } if (_hoverGlow.HasProperty("_EmissionColor")) { _hoverGlow.EnableKeyword("_EMISSION"); _hoverGlow.SetColor("_EmissionColor", new Color(0.03f, 0.65f, 2.5f)); } } } private static Material Material(Shader shader, string name, Color color, float metallic, float smoothness) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(shader) { name = "SHOPPING C.A.R.T. " + name }; if (val.HasProperty("_Color")) { val.SetColor("_Color", color); } if (val.HasProperty("_BaseColor")) { val.SetColor("_BaseColor", color); } if (val.HasProperty("_Metallic")) { val.SetFloat("_Metallic", metallic); } if (val.HasProperty("_SpecColor")) { val.SetColor("_SpecColor", new Color(0.98f, 0.99f, 1f)); } if (val.HasProperty("_Glossiness")) { val.SetFloat("_Glossiness", smoothness); } if (val.HasProperty("_Smoothness")) { val.SetFloat("_Smoothness", smoothness); } if (val.HasProperty("_GlossyReflections")) { val.SetFloat("_GlossyReflections", 1f); } Object.DontDestroyOnLoad((Object)(object)val); return val; } } }