43 lines
1005 B
C#
43 lines
1005 B
C#
public class NetPackageAdjustStats : global::NetPackage
|
|
{
|
|
private int _entityId;
|
|
|
|
public NetPackageAdjustStats Setup(int entityId)
|
|
{
|
|
_entityId = entityId;
|
|
return this;
|
|
}
|
|
|
|
public override void read(PooledBinaryReader br)
|
|
{
|
|
_entityId = br.ReadInt32();
|
|
}
|
|
|
|
public override void write(PooledBinaryWriter bw)
|
|
{
|
|
base.write(bw);
|
|
bw.Write(_entityId);
|
|
}
|
|
|
|
public override int GetLength()
|
|
{
|
|
return 8;
|
|
}
|
|
|
|
public override void ProcessPackage(World world, GameManager callbacks)
|
|
{
|
|
Log.Out("NetPackageAdjustStats-ProcessPackage START");
|
|
if (world == null)
|
|
{
|
|
Log.Out("NetPackageAdjustStats-ProcessPackage WORLD IS NULL");
|
|
return;
|
|
}
|
|
|
|
EntityNPCRebirth npc = (EntityNPCRebirth)world.GetEntity(this._entityId);
|
|
|
|
if (npc != null)
|
|
{
|
|
GameManager.Instance.StartCoroutine(RebirthUtilities.adjustNPCStats(npc));
|
|
}
|
|
}
|
|
} |