求大佬告知修改树上拿绳子改变数量代
:(:):):'(:'( 有了吗,是啥 ItemHold.Take leeahngi 发表于 2026-3-22 02:05ItemHold.Take
大佬 讲具体一点 看不懂代码啊
3dm_23374464 发表于 2026-5-5 20:27
大佬 讲具体一点 看不懂代码啊
public override bool Take(bool play_sound = true)
{
if (this.m_Hallucination)
{
base.Disappear(true);
return false;
}
int num = ((this.m_Info.m_ID == ItemID.Liane_ToHoldHarvest) ? 50 : 1);
Item item = null;
for (int i = 0; i < num; i++)
{
item = ItemsManager.Get().CreateItem(this.m_ReplaceInfoName, false);
if (InventoryBackpack.Get().InsertItem(item, null, null, true, true, true, true, true) != InsertResult.Ok)
{
global::UnityEngine.Object.Destroy(item.gameObject);
return false;
}
}
this.UpdateChildrenItems();
EventsManager.OnEvent(global::Enums.Event.TakeItem, num, (int)item.m_Info.m_ID, false);
if (base.m_CurrentSlot)
{
base.m_CurrentSlot.RemoveItem();
}
Player.Get().GetComponent<PlayerAudioModule>().PlayItemSound(item.m_Info);
base.AddItemsCountMessage(item);
if (item.m_Info != null && item.m_Info.IsHeavyObject())
{
PlayerAudioModule.Get().PlayHOPickupSound();
}
if (!this.m_IsThisUnlimited)
{
global::UnityEngine.Object.Destroy(base.gameObject);
}
if (this.m_Info.m_ID == ItemID.Liane_ToHoldHarvest)
{
LianasReplicator.Get().OnTakeLiane(base.gameObject);
}
return true;
}
}
leeahngi 发表于 2026-5-8 00:05
public override bool Take(bool play_sound = true)
{
if (this.m_Hallucination)
谢谢大佬 谢谢大佬
leeahngi 发表于 2026-5-8 00:05
public override bool Take(bool play_sound = true)
{
if (this.m_Hallucination)
成功了 非常感谢:lol
页:
[1]