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 Company Globes v1.1.1
plugins/GlobeScrap.dll
Decompiled 2 weeks agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using Chameleon.Patches; using Dawn; using Dawn.Utils; using Dusk; using GlobeScrap.Configs; using GlobeScrap.NetcodePatcher; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("CelestialTint")] [assembly: IgnoresAccessChecksTo("Chameleon")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("GlobeScrap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: AssemblyInformationalVersion("1.1.1")] [assembly: AssemblyProduct("GlobeScrap")] [assembly: AssemblyTitle("GlobeScrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 GlobeScrap { internal static class GlobeBuilder { public const string celestialTint_GUID = "CelestialTint"; public const string chameleon_GUID = "butterystancakes.lethalcompany.chameleon"; public const string artificeBlizzard_GUID = "butterystancakes.lethalcompany.artificeblizzard"; private static int cachedLeveID = -1; private static GameObject planetStorage; private static GameObject planetObject; public static List<PresetMoon> registeredMoons = new List<PresetMoon>(); private static bool ChameleonEnabled; private static bool SnowyArtEnabled; private static bool CelestialTintEnabled; private static Mesh planetMesh; private static Material artificeMatReference; private static Material embrionMatReference; private static Material gordionMatReference; private static Material desertMatReference; private static Material forestMatReference; private static Material snowyMatReference; public static void Initialise() { AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "globeimages"); desertMatReference = val.LoadAsset<Material>("Assets/LethalCompany/Mods/CompanyGlobes/Assets/DesertPlanet.mat"); forestMatReference = val.LoadAsset<Material>("Assets/LethalCompany/Mods/CompanyGlobes/Assets/ForestPlanet.mat"); snowyMatReference = val.LoadAsset<Material>("Assets/LethalCompany/Mods/CompanyGlobes/Assets/SnowPlanet.mat"); gordionMatReference = val.LoadAsset<Material>("Assets/LethalCompany/Mods/CompanyGlobes/Assets/OceanPlanet.mat"); planetMesh = val.LoadAsset<Mesh>("Assets/LethalCompany/Mods/CompanyGlobes/Assets/PlanetMesh.asset"); ((Registry<DawnMoonInfo>)(object)LethalContent.Moons).OnFreeze += delegate { RegisterCompatibilities(); MakePlanetStorage(); registeredMoons = MoonConfig.BuildMoonConfig(); }; } private static void RegisterCompatibilities() { ChameleonEnabled = Chainloader.PluginInfos.ContainsKey("butterystancakes.lethalcompany.chameleon"); SnowyArtEnabled = Chainloader.PluginInfos.ContainsKey("butterystancakes.lethalcompany.artificeblizzard"); if (Chainloader.PluginInfos.ContainsKey("CelestialTint")) { CelestialTintEnabled = CheckCT(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool CheckCT() { try { return !CelestialTint.ModConfig.VanillaMode.Value; } catch { return false; } } private static void MakePlanetStorage() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) planetStorage = new GameObject("planetStorage"); planetObject = new GameObject(); planetObject.transform.parent = planetStorage.transform; planetStorage.transform.position = new Vector3(0f, -10f, 1012f); } public static GameObject Build(SelectableLevel level) { if ((Object)(object)planetStorage == (Object)null) { MakePlanetStorage(); } if (cachedLeveID != level.levelID) { cachedLeveID = level.levelID; if (BuildPrefabbedPlanets(level)) { return planetObject; } if (CelestialTintEnabled || !BuildFromPrefab(level)) { BuildFromLevelTag(level); } } return planetObject; } private static bool BuildPrefabbedPlanets(SelectableLevel level) { switch (TrimPlanetName(level.PlanetName)) { case "Artifice": if (SnowyArtEnabled) { PresetMoon(snowyMatReference); return true; } if (ChameleonEnabled) { if ((Object)(object)artificeMatReference == (Object)null) { artificeMatReference = GetArtMat(); if ((Object)(object)artificeMatReference != (Object)null) { artificeMatReference.SetFloat("_Metallic", 0f); artificeMatReference.SetFloat("_Smoothness", 0.25f); artificeMatReference.SetFloat("_NormalScale", 0.1f); } } if ((Object)(object)artificeMatReference != (Object)null) { PresetMoon(artificeMatReference); return true; } } PresetMoon(forestMatReference); return true; case "Embrion": if (!ChameleonEnabled) { break; } if ((Object)(object)embrionMatReference == (Object)null) { embrionMatReference = GetEmbMat(); if ((Object)(object)embrionMatReference != (Object)null) { embrionMatReference.SetFloat("_Metallic", 0f); embrionMatReference.SetFloat("_Smoothness", 0.25f); embrionMatReference.SetFloat("_NormalScale", 0.1f); } } if ((Object)(object)embrionMatReference != (Object)null) { PresetMoon(embrionMatReference); } return true; case "Gordion": case "Liquidation": PresetMoon(gordionMatReference); return true; } return false; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static Material GetArtMat() { try { return PlanetPreviewPatches.artificeMat; } catch { return null; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static Material GetEmbMat() { try { return PlanetPreviewPatches.embrionMat; } catch { return null; } } private static bool BuildFromPrefab(SelectableLevel level) { //IL_0075: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) PresetMoon presetMoon = registeredMoons.Find((PresetMoon x) => x.name == TrimPlanetName(level.PlanetName)); if (CopyFromPrefab(level.planetPrefab.transform, presetMoon?.positionInPrefab ?? 0)) { planetObject.transform.localPosition = ((presetMoon == null || !presetMoon.positionOffset.HasValue) ? Vector3.zero : presetMoon.positionOffset.Value); planetObject.transform.localRotation = ((presetMoon == null || !presetMoon.rotationOffset.HasValue) ? Quaternion.identity : Quaternion.Euler(presetMoon.rotationOffset.Value)); if (presetMoon != null && presetMoon.scale.HasValue) { Transform transform = planetObject.transform; transform.localScale *= presetMoon.scale.Value; } planetObject.layer = 6; return true; } return false; } public static string TrimPlanetName(string name) { return name.TrimStart(' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-'); } private static void BuildFromLevelTag(SelectableLevel level) { foreach (NamespacedKey item in ((DawnBaseInfo<DawnMoonInfo>)(object)SelectableLevelExtensions.GetDawnInfo(level)).AllTags()) { switch (item.Key) { case "desert": case "canyon": case "wasteland": case "volcanic": case "rocky": case "argon": PresetMoon(desertMatReference); return; case "forest": case "valley": case "marsh": PresetMoon(forestMatReference); return; case "tundra": case "snow": PresetMoon(snowyMatReference); return; case "company": case "ocean": PresetMoon(gordionMatReference); return; } } PresetMoon(forestMatReference); } private static void PresetMoon(Material overrideMaterial) { MeshFilter val = planetObject.GetComponent<MeshFilter>() ?? planetObject.AddComponent<MeshFilter>(); val.mesh = planetMesh; MeshRenderer val2 = planetObject.GetComponent<MeshRenderer>() ?? planetObject.AddComponent<MeshRenderer>(); ((Renderer)val2).material = overrideMaterial; } private static bool CopyFromPrefab(Transform reference, int prefabPosition) { //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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c3: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) MeshFilter[] componentsInChildren = ((Component)reference).GetComponentsInChildren<MeshFilter>(); Transform transform = ((Component)componentsInChildren[prefabPosition]).transform; ((Object)planetObject).name = ((Object)transform).name; MeshFilter component = ((Component)transform).GetComponent<MeshFilter>(); MeshRenderer component2 = ((Component)transform).GetComponent<MeshRenderer>(); if ((Object)(object)component != (Object)null && (Object)(object)component2 != (Object)null) { CopyMeshFilter(component, planetObject.gameObject); CopyMeshRenderer(component2, planetObject.gameObject); float[] array = new float[3]; Bounds bounds = component.mesh.bounds; array[0] = ((Bounds)(ref bounds)).size.x; bounds = component.mesh.bounds; array[1] = ((Bounds)(ref bounds)).size.y; bounds = component.mesh.bounds; array[2] = ((Bounds)(ref bounds)).size.z; float num = 2f / Mathf.Max(array); planetObject.transform.localScale = Vector3.one * num; Transform transform2 = planetObject.transform; bounds = component.mesh.bounds; transform2.position = -((Bounds)(ref bounds)).center * num; return true; } return false; } private static void CopyMeshFilter(MeshFilter original, GameObject destination) { MeshFilter val = destination.GetComponent<MeshFilter>() ?? destination.AddComponent<MeshFilter>(); val.mesh = original.sharedMesh; } private static void CopyMeshRenderer(MeshRenderer original, GameObject destination) { MeshRenderer val = destination.GetComponent<MeshRenderer>() ?? destination.AddComponent<MeshRenderer>(); ((Renderer)val).materials = ((Renderer)original).sharedMaterials; ((Renderer)val).material.SetFloat("_Metallic", 0f); ((Renderer)val).material.SetFloat("_Smoothness", 0.25f); ((Renderer)val).material.SetFloat("_NormalScale", 0.1f); } } internal class GlobeContentHandler : ContentHandler<GlobeContentHandler> { public GlobeContentHandler(DuskMod mod) : base(mod) { DefaultBundle val = default(DefaultBundle); ((ContentHandler)this).RegisterContent<DefaultBundle>("globescrap", ref val, true); } } [BepInPlugin("CompanyGlobes", "CompanyGlobes", "1.1.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string DawnDep = "com.github.teamxiaolan.dawnlib"; public const string PLUGIN_GUID = "CompanyGlobes"; public const string PLUGIN_NAME = "CompanyGlobes"; public const string PLUGIN_VERSION = "1.1.1"; internal static Harmony Harmony { get; set; } public static DuskMod Mod { get; private set; } private void Awake() { AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "globemain"); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); GlobeBuilder.Initialise(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin GlobeScrap is loaded!"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "GlobeScrap"; public const string PLUGIN_NAME = "GlobeScrap"; public const string PLUGIN_VERSION = "1.1.1"; } } namespace GlobeScrap.Configs { internal class MoonConfig { private static readonly List<PresetMoon> presetMoons = new List<PresetMoon>(39) { new PresetMoon("Assurance", 1), new PresetMoon("Asteroid-13", 44, null, null, 0.67f), new PresetMoon("Awakening", 2), new PresetMoon("Bilge", 1), new PresetMoon("Calist", 1, (Vector3?)null, (Vector3?)new Vector3(0f, 90f, 0f), (float?)null), new PresetMoon("Cubatres", 0, (Vector3?)null, (Vector3?)new Vector3(316.6853f, 143.8695f, 272.1489f), (float?)0.67f), new PresetMoon("Chronos", 1), new PresetMoon("Core", 1), new PresetMoon("Desolation", 0, null, null, 0.67f), new PresetMoon("Duckstroid-14", 1, (Vector3?)new Vector3(-0.0026f, -0.32f, -1.001f), (Vector3?)null, (float?)null), new PresetMoon("Espira", 1), new PresetMoon("Experimentation", 1), new PresetMoon("Faith", 1), new PresetMoon("Filitrios", 1), new PresetMoon("Gratar", 1), new PresetMoon("Hope", 113), new PresetMoon("Hyve", 19, null, null, 0.67f), new PresetMoon("Impact", 112), new PresetMoon("Infernis", 2), new PresetMoon("Kanie", 1), new PresetMoon("Kiln", 1), new PresetMoon("Kiri", 1), new PresetMoon("Lecaro", 0, null, null, 0.67f), new PresetMoon("Lithium", 1), new PresetMoon("Lua", 1), new PresetMoon("Navel", 113), new PresetMoon("Obscura", 1), new PresetMoon("Offense", 1), new PresetMoon("Oxyde", 0, (Vector3?)null, (Vector3?)new Vector3(0f, 0f, 90f), (float?)null), new PresetMoon("Outpost 31", 0, (Vector3?)null, (Vector3?)new Vector3(90f, 0f, 0f), (float?)null), new PresetMoon("Praetor", 1), new PresetMoon("Perplexing", 2), new PresetMoon("Phobos / Deimos", 11), new PresetMoon("Repose", 2), new PresetMoon("Row", 1), new PresetMoon("Spring", 113), new PresetMoon("Terra", 1), new PresetMoon("Trial", 112), new PresetMoon("Wistful", 1) }; public static List<PresetMoon> BuildMoonConfig() { List<PresetMoon> list = new List<PresetMoon>(); foreach (KeyValuePair<NamespacedKey<DawnMoonInfo>, DawnMoonInfo> item in (Registry<DawnMoonInfo>)(object)LethalContent.Moons) { if (!(item.Value.GetNumberlessPlanetName() == string.Empty)) { MeshFilter[] componentsInChildren = item.Value.Level.planetPrefab.GetComponentsInChildren<MeshFilter>(); string planetName = GlobeBuilder.TrimPlanetName(((Registry<DawnMoonInfo>)(object)LethalContent.Moons)[item.Key].Level.PlanetName); PresetMoon presetMoon = presetMoons.Find((PresetMoon x) => x.name == planetName); if (presetMoon != null) { list.Add(presetMoon); } } } return list; } } public class PresetMoon { public string name; public int positionInPrefab; public Vector3? positionOffset; public Vector3? rotationOffset; public float? scale; public PresetMoon(string name, int positionInPrefab, Vector3? positionOffset = null, Vector3? rotationOffset = null, float? scale = null) { this.name = name; this.positionInPrefab = positionInPrefab; this.positionOffset = positionOffset; this.rotationOffset = rotationOffset; this.scale = scale; base..ctor(); } } } namespace GlobeScrap.Behaviours { public static class ChangeLevelPatch { [HarmonyPatch(typeof(StartOfRound), "ChangeLevel")] [HarmonyPostfix] public static void ChangeLevel() { GlobeFurniture.ChangePlanet(); } } public class GlobeBehaviour : GrabbableObject { [CompilerGenerated] private sealed class <SpinGlobe>d__14 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlobeBehaviour <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpinGlobe>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isSpinning = true; <>4__this.spinTime = Mathf.Min(<>4__this.spinTime, (float)Random.Range(0, 10) / 10f); break; case 1: <>1__state = -1; break; } if (<>4__this.spinTime < 2.5f && !((GrabbableObject)<>4__this).isPocketed) { <>4__this.planetContainer.Rotate(Vector3.forward, (0f - <>4__this.spinSpeed) * <>4__this.spinDecceleration.Evaluate(<>4__this.spinTime), (Space)1); <>4__this.spinTime += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>4__this.isSpinning = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <WaitForID>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GlobeBehaviour <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <WaitForID>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0046; case 1: <>1__state = -1; goto IL_0046; case 2: { <>1__state = -1; <>4__this.InitializeItem(<>4__this.planetID); return false; } IL_0046: if (!<>4__this.isSet) { <>2__current = null; <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform planetContainer; public float spinSpeed = 8f; public AnimationCurve spinDecceleration; private bool isSpinning; private float spinTime; private int planetID; private bool isSet = false; public override void Start() { ((GrabbableObject)this).Start(); ((MonoBehaviour)this).StartCoroutine(WaitForID()); if (!isSet && ((NetworkBehaviour)this).IsServer) { SyncPlanetIDRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncPlanetIDRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0077: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(910179441u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 910179441u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; planetID = StartOfRound.Instance.currentLevelID; isSet = true; } } } [IteratorStateMachine(typeof(<WaitForID>d__9))] private IEnumerator WaitForID() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <WaitForID>d__9(0) { <>4__this = this }; } private void InitializeItem(int planetID) { GameObject val = GlobeBuilder.Build(StartOfRound.Instance.levels[planetID]); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)planetContainer.GetChild(0)).gameObject); ScanNodeProperties componentInChildren = ((Component)this).gameObject.GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren == (Object)null) { Debug.LogError((object)("Scan node is missing for item!: " + ((Object)((Component)this).gameObject).name)); return; } componentInChildren.headerText = GlobeBuilder.TrimPlanetName(StartOfRound.Instance.levels[planetID].PlanetName) + " Globe"; Object.Instantiate<GameObject>(val, planetContainer, false); } } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return planetID; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); planetID = saveData; int num = StartOfRound.Instance.levels.Length; if (planetID > num) { planetID %= num; } isSet = true; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && !isSpinning) { ((MonoBehaviour)this).StartCoroutine(SpinGlobe()); } } [IteratorStateMachine(typeof(<SpinGlobe>d__14))] private IEnumerator SpinGlobe() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpinGlobe>d__14(0) { <>4__this = this }; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(910179441u, new RpcReceiveHandler(__rpc_handler_910179441), "SyncPlanetIDRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_910179441(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GlobeBehaviour)(object)target).SyncPlanetIDRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GlobeBehaviour"; } } internal class GlobeFurniture : NetworkBehaviour { public Transform planetContainer = null; public float passiveSpinRotation = 1f; private float addedSpinRotation; public float spinDecayRate = 2f; private static readonly SimpleEvent PlanetChangedEvent = new SimpleEvent(); private void OnEnable() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((UnityEvent)PlanetChangedEvent).AddListener(new UnityAction(MakeGlobe)); } private void OnDisable() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown ((UnityEvent)PlanetChangedEvent).RemoveListener(new UnityAction(MakeGlobe)); } private void Start() { MakeGlobe(); } private void MakeGlobe() { if (planetContainer.childCount > 0) { Object.Destroy((Object)(object)((Component)planetContainer.GetChild(0)).gameObject); } GameObject val = GlobeBuilder.Build(StartOfRound.Instance.currentLevel); if ((Object)(object)val != (Object)null) { Object.Instantiate<GameObject>(val, planetContainer, false); } } public void TriggerInteraction() { addedSpinRotation = 10f; } public static void ChangePlanet() { ((UnityEvent)PlanetChangedEvent).Invoke(); } public void Update() { //IL_000d: 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) planetContainer.Rotate(((Component)this).transform.up * (passiveSpinRotation + addedSpinRotation)); if (addedSpinRotation > 0f) { addedSpinRotation = Mathf.Max(addedSpinRotation - spinDecayRate * Time.deltaTime, 0f); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GlobeFurniture"; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace GlobeScrap.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }