public static void LoadSpecialPoints(BuildingInfo info, ushort buildingID, ref Building data) { Scripts.ClearProps(true); var pos = data.m_position; var q = Quaternion.AngleAxis(data.m_angle * 57.29578f, Vector3.down); var matrix4x4 = new Matrix4x4(); matrix4x4.SetTRS(pos, q, Vector3.one); if (info.m_buildingAI is DepotAI ai) { if (ai.m_transportInfo != null) { var mSpawnPoints = ai.m_spawnPoints; if (mSpawnPoints == null || mSpawnPoints.Length == 0) { mSpawnPoints = new[] { new DepotAI.SpawnPoint { m_position = ai.m_spawnPosition, m_target = ai.m_spawnTarget } }; } for (var index = 0; index < mSpawnPoints.Length; ++index) { PlaceSpecialPoint(info, matrix4x4, mSpawnPoints[index].m_position, SpecialPointType.SpawnPointPosition); PlaceSpecialPoint(info, matrix4x4, mSpawnPoints[index].m_target, SpecialPointType.SpawnPointTarget); } } if (ai.m_secondaryTransportInfo != null) { var mSpawnPoints2 = ai.m_spawnPoints2; if (mSpawnPoints2 == null || mSpawnPoints2.Length == 0) { mSpawnPoints2 = new[] { new DepotAI.SpawnPoint { m_position = ai.m_spawnPosition2, m_target = ai.m_spawnTarget2 } }; } for (var index = 0; index < mSpawnPoints2.Length; ++index) { PlaceSpecialPoint(info, matrix4x4, mSpawnPoints2[index].m_position, SpecialPointType.SpawnPoint2Position); PlaceSpecialPoint(info, matrix4x4, mSpawnPoints2[index].m_target, SpecialPointType.SpawnPoint2Target); } } } if (info.m_buildingAI is CargoStationAI ai2) { if (ai2.m_transportInfo != null) { PlaceSpecialPoint(info, matrix4x4, ai2.m_spawnPosition, SpecialPointType.SpawnPointPosition); PlaceSpecialPoint(info, matrix4x4, ai2.m_spawnTarget, SpecialPointType.SpawnPointTarget); } if (ai2.m_transportInfo2 != null) { PlaceSpecialPoint(info, matrix4x4, ai2.m_spawnPosition2, SpecialPointType.SpawnPoint2Position); PlaceSpecialPoint(info, matrix4x4, ai2.m_spawnTarget2, SpecialPointType.SpawnPoint2Target); } PlaceSpecialPoint(info, matrix4x4, ai2.m_truckSpawnPosition, SpecialPointType.TruckSpawnPosition); PlaceSpecialPoint(info, matrix4x4, ai2.m_truckUnspawnPosition, SpecialPointType.TruckDespawnPosition); } if (info.m_buildingAI is FishingHarborAI ai3) { PlaceSpecialPoint(info, matrix4x4, ai3.m_boatUnspawnPosition, SpecialPointType.DespawnPointPosition); PlaceSpecialPoint(info, matrix4x4, ai3.m_boatSpawnPosition, SpecialPointType.SpawnPointPosition); PlaceSpecialPoint(info, matrix4x4, ai3.m_boatUnspawnTarget, SpecialPointType.DespawnPointTarget); PlaceSpecialPoint(info, matrix4x4, ai3.m_boatSpawnTarget, SpecialPointType.SpawnPointTarget); } }