Upload from upload_mods.ps1
This commit is contained in:
47
Scripts/Network/NetPackageSetNavObjectRebirth.cs
Normal file
47
Scripts/Network/NetPackageSetNavObjectRebirth.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user