/// <summary> /// Reads the object from NBT and sets it's state. /// </summary> public virtual void readFromNbt(NbtCompound tag) { // Don't read id from NBT. this.transform.position = tag.getVector3("position"); this.transform.eulerAngles = tag.getVector3("eulerRotation"); this.transform.localScale = tag.getVector3("localScale", Vector3.one); this.immutable = tag.getBool("isImmutable"); this.guid = new Guid(tag.getString("guid")); }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.lastPos = tag.getVector3("lastPos"); this.unitStats = new UnitStats(tag, this.getData()); bool flag = tag.getBool("hasMovementOverride"); if (flag) { this.overrideMovementDestination = tag.getVector3("overrideMovementDestination"); this.overrideMovementStopDis = tag.getFloat("overrideMovementStopDis"); } }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.lastPos = tag.getVector3("lastPos"); this.unitStats = new UnitStats(tag, this.unitData); bool flag = tag.getBool("hasMovementOverride"); if (flag) { this.overrideMovementDestination = tag.getVector3("overrideMovementDestination"); this.overrideMovementStopDis = tag.getFloat("overrideMovementStopDis"); this.moveHelper.setDestination((Vector3)this.overrideMovementDestination, this.overrideMovementStopDis); } NbtCompound tagTask = tag.getCompound("task"); ITask task = (ITask)Activator.CreateInstance(TaskManager.getTaskFromId(tagTask.getInt("taskID")), new object[] { (UnitBase)this }); task.readFromNbt(tagTask); this.setTask(task, true); }
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 void readFromNbt(NbtCompound tag) { this.generatorId = tag.getInt("generatorId"); this.seed = tag.getInt("seed"); CameraMover.instance().setPostion(tag.getVector3("cameraPosition")); NbtCompound tagTeams = tag.getCompound("teams"); foreach (Team team in Team.ALL_TEAMS) { team.readFromNbt(tagTeams); } this.dayNightCycle.readFromNbt(tag); }
public void readFromNbt(NbtCompound tag) { this.playerCam.transform.position = tag.getVector3("playerPosition"); }
public override void readFromNbt(NbtCompound tag) { base.readFromNbt(tag); this.pointToDefend = tag.getVector3("defendPoint"); }