Decompiled source of de dust2 v1.0.1

CWDust2.dll

Decompiled 3 weeks ago
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using CWMapApi;
using CWMapApi.Api;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CWDust2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CWDust2")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("C2188619-A819-4D60-99FD-5C26A3CB9AD1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CWDust2;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.merqury.cw.map.dust2", "Dust 2", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private class Dust2 : CustomMap
	{
		public override string GetMapName()
		{
			return "Dust 2";
		}

		public override string GetSceneName()
		{
			return "Dust2Scene";
		}

		public override GameObject GetPatrolPoints()
		{
			return ((CustomMap)this).GetGameObjectInMyMap("PatrolPoints");
		}

		public override GameObject GetDiveBells()
		{
			return ((CustomMap)this).GetGameObjectInMyMap("DiveBells");
		}

		public override GameObject GetNavmesh()
		{
			return ((CustomMap)this).GetGameObjectInMyMap("navmesh");
		}

		public override GameObject GetNavmeshWide()
		{
			return ((CustomMap)this).GetGameObjectInMyMap("navmesh_Wide");
		}

		public override GameObject GetLevel()
		{
			return ((CustomMap)this).GetGameObjectInMyMap("World");
		}

		public override IEnumerator Prefix()
		{
			((CustomMap)this).SetDefaultWorldMaterialRecursive(((CustomMap)this).GetGameObjectInMyMap("World"));
			((CustomMap)this).SetDefaultSkybox();
			yield return <>n__0();
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private IEnumerator <>n__0()
		{
			return ((CustomMap)this).Prefix();
		}
	}

	private static PluginInfo pluginInfo;

	private static ManualLogSource logger;

	private void Awake()
	{
		logger = ((BaseUnityPlugin)this).Logger;
		pluginInfo = ((BaseUnityPlugin)this).Info;
		AssetBundle.LoadFromFile(Path.Combine(pluginInfo.Location, "..", "map"));
		MapApi.RegisterCustomMap((CustomMap)(object)new Dust2());
	}
}