67 lines
2.4 KiB
C#
67 lines
2.4 KiB
C#
using UnityEngine.Scripting;
|
|
|
|
[Preserve]
|
|
public class NetPackageSynchZombieInfoRebirth : NetPackage
|
|
{
|
|
public NetPackageSynchZombieInfoRebirth Setup(int targetId, string _otherTags, string _entityName, string _lootListOnDeath = "")
|
|
{
|
|
this.m_targetId = targetId;
|
|
this.otherTags = _otherTags;
|
|
this.entityName = _entityName;
|
|
this.lootListOnDeath = _lootListOnDeath;
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-Setup this.m_targetId: " + this.m_targetId);
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-Setup this.otherTags: " + this.otherTags);
|
|
return this;
|
|
}
|
|
|
|
public override void read(PooledBinaryReader _reader)
|
|
{
|
|
this.m_targetId = _reader.ReadInt32();
|
|
this.otherTags = _reader.ReadString();
|
|
this.entityName = _reader.ReadString();
|
|
this.lootListOnDeath = _reader.ReadString();
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-read this.otherTags: " + this.otherTags);
|
|
}
|
|
|
|
public override void write(PooledBinaryWriter _writer)
|
|
{
|
|
base.write(_writer);
|
|
_writer.Write(this.m_targetId);
|
|
_writer.Write(this.otherTags);
|
|
_writer.Write(this.entityName);
|
|
_writer.Write(this.lootListOnDeath);
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-write this.otherTags: " + this.otherTags);
|
|
}
|
|
|
|
public override void ProcessPackage(World _world, GameManager _callbacks)
|
|
{
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-ProcessPackage 1");
|
|
if (_world == null || !_world.IsRemote())
|
|
{
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-ProcessPackage 2");
|
|
return;
|
|
}
|
|
EntityZombieSDX entityAlive = _world.GetEntity(this.m_targetId) as EntityZombieSDX;
|
|
if (entityAlive == null)
|
|
{
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-ProcessPackage 3");
|
|
return;
|
|
}
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-ProcessPackage entityAlive.otherTags: " + entityAlive.otherTags);
|
|
entityAlive.otherTags = this.otherTags;
|
|
entityAlive.SetEntityName(entityName);
|
|
entityAlive.lootListOnDeath = this.lootListOnDeath;
|
|
//Log.Out("NetPackageSynchOtherTagsRebirth-ProcessPackage this.otherTags: " + this.otherTags);
|
|
}
|
|
|
|
public override int GetLength()
|
|
{
|
|
return 8;
|
|
}
|
|
|
|
private int m_targetId;
|
|
private string otherTags;
|
|
private string entityName;
|
|
private string lootListOnDeath;
|
|
}
|