梦醒时见忆苕溪 发表于 2026-3-20 03:46

求大佬告知修改树上拿绳子改变数量代

:(:):):'(:'(

3dm_33253664 发表于 2026-3-21 18:51

有了吗,是啥

leeahngi 发表于 2026-3-22 02:05

ItemHold.Take

3dm_23374464 发表于 2026-5-5 20:27

leeahngi 发表于 2026-3-22 02:05
ItemHold.Take

大佬 讲具体一点 看不懂代码啊

leeahngi 发表于 2026-5-8 00:05

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;
    }
}

3dm_23374464 发表于 2026-5-9 13:28

leeahngi 发表于 2026-5-8 00:05
public override bool Take(bool play_sound = true)
    {
      if (this.m_Hallucination)


谢谢大佬 谢谢大佬

3dm_23374464 发表于 2026-5-9 13:59

leeahngi 发表于 2026-5-8 00:05
public override bool Take(bool play_sound = true)
    {
      if (this.m_Hallucination)


成功了 非常感谢:lol
页: [1]
查看完整版本: 求大佬告知修改树上拿绳子改变数量代