-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomEntityStuffPatch.cs
More file actions
36 lines (33 loc) · 1.16 KB
/
CustomEntityStuffPatch.cs
File metadata and controls
36 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using HarmonyLib;
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
namespace PainMod
{
[HarmonyPatch]
internal class CustomEntityStuffPatch
{
[HarmonyPatch(typeof(Projectile), nameof(Projectile.OnOccupied))]
[HarmonyPostfix]
public static void OnOccupied(Projectile __instance)
{
/*Plugin.logger.LogInfo("My projectile launched with " + __instance.lastPos.ToString());
CustomEnergyModProjectile myProjectile = __instance.TryCast<CustomEnergyModProjectile>();
if (myProjectile != null)
{
Plugin.logger.LogInfo("My projectile is not null");
myProjectile.OnOccupied();
}
else
{
Plugin.logger.LogError("My projectile is null");
}*/
}
[HarmonyPatch(typeof(EntityCommandBuffer), nameof(EntityCommandBuffer.Instantiate))]
[HarmonyPrefix]
public static unsafe void Thing(EntityCommandBuffer __instance)
{
Plugin.logger.LogInfo("Entity command buffer created and m_data being null is " + (__instance.m_Data==null));
}
}
}