File tree 1 file changed +25
-0
lines changed
NitroxPatcher/Patches/Dynamic
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System . Reflection ;
2
+ using NitroxClient . GameLogic ;
3
+ using NitroxModel . Helper ;
4
+ using UnityEngine ;
5
+
6
+ namespace NitroxPatcher . Patches . Dynamic ;
7
+
8
+ /// <summary>
9
+ /// Event when someone picks up an item.
10
+ /// </summary>
11
+ public sealed partial class ResourceTracker_OnPickedUp_Patch : NitroxPatch , IDynamicPatch
12
+ {
13
+ private static readonly MethodInfo TARGET_METHOD = Reflect . Method ( ( ResourceTracker d ) => d . OnPickedUp ( default ) ) ;
14
+
15
+ public static bool Prefix ( ResourceTracker __instance )
16
+ {
17
+ TechType instanceTechType = __instance . techType ;
18
+ GameObject instanceGameObject = __instance . gameObject ;
19
+ if ( instanceTechType != null && instanceGameObject != null )
20
+ {
21
+ Resolve < Items > ( ) . PickedUp ( instanceGameObject , instanceTechType ) ;
22
+ }
23
+ return true ;
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments