<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[The Escapists 2 + Unity + dnSpy] Спавн итемов]]></title><description><![CDATA[<h2>Спавн итемов удалось сделать через dnSpy</h2>
<p dir="auto">При клике на любой предмет на меню крафта он создается в инвентаре, а если там занято, то выкидывается на карту.</p>
<p dir="auto">Я переписал метод клика на рецепт, вот он оригинальный</p>
<pre><code>// Token: 0x060069FA RID: 27130 RVA: 0x00254874 File Offset: 0x00252A74
	private void OnRecipeSlotClicked(int recipeSlotID)
	{
		if (recipeSlotID == this.m_CurrentClickedRecipeID)
		{
			if (!T17RewiredStandaloneInputModule.IsCurrentActiveModuleUsingController())
			{
				this.m_CurrentClickedRecipeID = -1;
			}
			return;
		}
		if (!this.CheckHasItemsForRecipe(recipeSlotID))
		{
			this.m_CurrentClickedRecipeID = -1;
			return;
		}
		CraftManager.Recipe recipeByID = CraftManager.GetInstance().GetRecipeByID(recipeSlotID);
		if (recipeByID != null &amp;&amp; (!recipeByID.m_bHidden || recipeByID.m_bDiscovered))
		{
			this.FillSlots(recipeSlotID);
			this.m_CurrentClickedRecipeID = recipeSlotID;
			return;
		}
		this.m_CurrentClickedRecipeID = -1;
	}
</code></pre>
<p dir="auto">На этот</p>
<pre><code>private void OnRecipeSlotClicked(int recipeSlotID)
	{
		int itemDataID = CraftManager.GetInstance().GetCurrentRecipes()[recipeSlotID].m_Product.m_ItemDataID;
		Character character = base.CurrentGamePlayer.GetComponent();
		ItemManager.GetInstance().AssignItemRPC(character.m_NetView.ownerId, itemDataID, new ItemManager.ItemManagerEvent(this.OnStandingAnimItemSpawn), ref character.m_StandingStillEquipID, -1);
	}

	private void OnStandingAnimItemSpawn(Item item, int eventID)
	{
		if (base.CurrentGamePlayer.GetComponent().m_StandingStillEquipID == eventID)
		{
			Player player = base.CurrentGamePlayer;
			bool flag = false;
			if (player.GetEquippedItem() == null)
			{
				flag = player.SetEquippedItem(item, true, false, RPC_CallContexts.Master);
			}
			if (!flag)
			{
				item.DropItemInLevel(player, player.transform.position);
			}
		}
	}
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1680954621141-7c8381aa-0c85-466d-9743-42edabd7eb9c-%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png" alt="7c8381aa-0c85-466d-9743-42edabd7eb9c-изображение.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1680954639295-ac1cd6a8-5078-48ea-9f4a-3d605db0971c-%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5.png" alt="ac1cd6a8-5078-48ea-9f4a-3d605db0971c-изображение.png" class=" img-fluid img-markdown" /><br />
Для спавна заменить Assembly-CSharp.dll из архива, сделав копию предварительно<br />
<a href="/assets/uploads/files/1680954663797-assembly-csharp.rar">Assembly-CSharp.rar</a></p>
]]></description><link>https://celua.ru/topic/67/the-escapists-2-unity-dnspy-спавн-итемов</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 03:11:31 GMT</lastBuildDate><atom:link href="https://celua.ru/topic/67.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Apr 2023 11:52:12 GMT</pubDate><ttl>60</ttl></channel></rss>