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