public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.damage = tag.getInt("damageDelt"); this.target = (LivingObject)this.map.findMapObjectFromGuid(tag.getGuid("target")); Guid guid = tag.getGuid("shooter"); this.shooter = (SidedObjectEntity)(guid != Guid.Empty ? this.map.findMapObjectFromGuid(guid) : null); }
public virtual void readFromNbt(NbtCompound tag) { this.transform.position = tag.getVector2("position"); this.depth = tag.getInt("depth"); this.rotation = Rotation.ALL[Mathf.Clamp(tag.getInt("facing"), 0, 3)]; this.guid = tag.getGuid("guid"); }
public SpawnInstructions <T> spawnEntity <T>(RegisteredObject registeredObj, NbtCompound tag) where T : MapObject { GameObject gameObj = GameObject.Instantiate(registeredObj.getPrefab()); T mapObject = this.setupMapObj <T>(gameObj); mapObject.guid = tag.getGuid("guid"); return(new SpawnInstructions <T>(mapObject)); }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.timeWhacking = tag.getFloat("timeWhacking"); this.whackPoint = tag.getVector3("whackPoint"); this.moveHelper.setDestination(this.whackPoint); BuildingBase b = this.unit.map.findMapObjectFromGuid <BuildingBase>(tag.getGuid("building")); if (b != null) { this.setBuilding(b); } }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.fireCooldown = tag.getFloat("fireCooldown"); MapObject obj = this.map.findMapObjectFromGuid <MapObject>(tag.getGuid("targetGuid")); if (obj is UnitBase) { this.target = (UnitBase)obj; } else { this.target = null; } }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.harvestCooldown = tag.getFloat("cooldown"); this.target = this.unit.map.findMapObjectFromGuid <HarvestableObject>(tag.getGuid("target")); }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.target = this.unit.map.findMapObjectFromGuid <LivingObject>(tag.getGuid("target")); }