Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / buff / buff / Buff_ActivePropsCapacity.cs
@小李xl 小李xl on 22 Mar 2024 613 bytes 道具逻辑片段更新参数描述
  1.  
  2. using System.Text.Json;
  3.  
  4. [BuffFragment(
  5. "ActivePropsCapacity",
  6. "主动道具背包容量 buff",
  7. Arg1 = "(int)主动道具背包增加的容量"
  8. )]
  9. public class Buff_ActivePropsCapacity : BuffFragment
  10. {
  11. private int _value;
  12.  
  13. public override void InitParam(JsonElement[] arg)
  14. {
  15. _value = arg[0].GetInt32();
  16. }
  17.  
  18. public override void OnPickUpItem()
  19. {
  20. Role.ActivePropsPack.SetCapacity(Role.ActivePropsPack.Capacity + _value);
  21. }
  22.  
  23. public override void OnRemoveItem()
  24. {
  25. Role.ActivePropsPack.SetCapacity(Role.ActivePropsPack.Capacity - _value);
  26. }
  27. }