using UnityEngine.Scripting; [Preserve] public class NetPackageSetNavObjectRebirth : NetPackage { public NetPackageSetNavObjectRebirth Setup(int targetId, string iconName) { this.m_targetId = targetId; this.iconName = iconName; return this; } public override void read(PooledBinaryReader _reader) { this.m_targetId = _reader.ReadInt32(); this.iconName = _reader.ReadString(); } public override void write(PooledBinaryWriter _writer) { base.write(_writer); _writer.Write(this.m_targetId); _writer.Write(this.iconName); } public override void ProcessPackage(World _world, GameManager _callbacks) { if (_world == null || !_world.IsRemote()) { return; } EntityAlive entityAlive = _world.GetEntity(this.m_targetId) as EntityAlive; if (entityAlive == null) { return; } entityAlive.AddNavObject(this.iconName, "", ""); } public override int GetLength() { return 8; } private int m_targetId; private string iconName; }