예제 #1
0
        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);
        }
예제 #2
0
 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");
 }
예제 #3
0
    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));
    }
예제 #4
0
    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);
        }
    }
예제 #5
0
    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;
        }
    }
예제 #6
0
    public override void readFromNbt(NbtCompound tag)
    {
        base.readFromNbt(tag);

        this.harvestCooldown = tag.getFloat("cooldown");
        this.target          = this.unit.map.findMapObjectFromGuid <HarvestableObject>(tag.getGuid("target"));
    }
예제 #7
0
    public override void readFromNbt(NbtCompound tag)
    {
        base.readFromNbt(tag);

        this.target = this.unit.map.findMapObjectFromGuid <LivingObject>(tag.getGuid("target"));
    }