diff --git a/Assets/Scripts/Functional Definitions/Interaction Definitions/SectorManager.cs b/Assets/Scripts/Functional Definitions/Interaction Definitions/SectorManager.cs index ce465fbd8..934f01cd3 100644 --- a/Assets/Scripts/Functional Definitions/Interaction Definitions/SectorManager.cs +++ b/Assets/Scripts/Functional Definitions/Interaction Definitions/SectorManager.cs @@ -885,11 +885,21 @@ public Entity SpawnEntity(EntityBlueprint blueprint, Sector.LevelEntity data) case EntityBlueprint.IntendedType.Turret: { gObj.AddComponent(); + json = data.blueprintJSON; + if (!string.IsNullOrEmpty(json)) + { + blueprint = TryGettingEntityBlueprint(json); + } break; } case EntityBlueprint.IntendedType.Tank: { gObj.AddComponent(); + json = data.blueprintJSON; + if (!string.IsNullOrEmpty(json)) + { + blueprint = TryGettingEntityBlueprint(json); + } break; } case EntityBlueprint.IntendedType.Bunker: @@ -926,6 +936,11 @@ public Entity SpawnEntity(EntityBlueprint blueprint, Sector.LevelEntity data) case EntityBlueprint.IntendedType.Drone: { Drone drone = gObj.AddComponent(); + json = data.blueprintJSON; + if (!string.IsNullOrEmpty(json)) + { + blueprint = TryGettingEntityBlueprint(json); + } //drone.path = ResourceManager.GetAsset(data.pathID); break; } diff --git a/Assets/World Creator Assets/Scripts/WCGeneratorHandler.cs b/Assets/World Creator Assets/Scripts/WCGeneratorHandler.cs index 7bb1b02d6..fef82681e 100644 --- a/Assets/World Creator Assets/Scripts/WCGeneratorHandler.cs +++ b/Assets/World Creator Assets/Scripts/WCGeneratorHandler.cs @@ -379,6 +379,13 @@ IEnumerator WriteWorldCo(string path) } var charExists = cursor.characters.Exists(ch => ch.ID == ent.ID); + var jsonSensitiveAssets = new List() {"groundcarrier_blueprint" ,"carrier_blueprint" ,"outpost_blueprint" + ,"bunker_blueprint" ,"missile_station" ,"air_weapon_station", "defense_turret", + "siege_turret", "harvester_turret", "missile_turret", "torpedo_turret", "mini_drone_blueprint", "worker_drone_blueprint", + "strike_drone_blueprint", "light_drone_blueprint", "gun_drone_blueprint", "counter_drone_blueprint", + "torpedo_drone_blueprint", "heavy_drone_blueprint", "speeder_tank", "bullet_tank", + "missile_tank", "beam_tank", "laser_tank", "rocket_tank"}; + if (ent.assetID == "shellcore_blueprint" || charExists) { if (container.type != Sector.SectorType.SiegeZone && !sectTargetIDS[container].Contains(ent.ID)) @@ -428,8 +435,8 @@ IEnumerator WriteWorldCo(string path) AttemptAddPartArray(traderInventory.parts, container.sectorName); } } - else if (ent.assetID == "groundcarrier_blueprint" || ent.assetID == "carrier_blueprint" || ent.assetID == "outpost_blueprint" - || ent.assetID == "bunker_blueprint" || ent.assetID == "missile_station" || ent.assetID == "air_weapon_station") + + else if (jsonSensitiveAssets.Contains(ent.assetID)) { ent.blueprintJSON = item.shellcoreJSON; }