public void SpawnTransportationNode() { HackTarget newHackTarget = ScriptableObject.CreateInstance <HackTarget>(); newHackTarget.SetupHackTarget("Transportation"); hackTargets.Add(newHackTarget); }
private void SetupHacksAndObjects(bool isFirstSquare) { SetupHackObjectSpawnLists(isFirstSquare); // random 1-3 int objectsToSpawn = Random.Range(1, 4); while (objectsToSpawn > 0) { int random = Random.Range(0, 100); if (random <= 45) { HackTarget newHackTarget = ScriptableObject.CreateInstance <HackTarget>(); string newHackType = availableHackTypes[Random.Range(0, availableHackTypes.Count)]; if (newHackType == "Transportation") { hasTransportationNode = true; parentRow.GetMapGrid().AddATransportationNode(); } newHackTarget.SetupHackTarget(newHackType); availableHackTypes.Remove(newHackType); hackTargets.Add(newHackTarget); objectsToSpawn--; } else if (random > 45) { MapObject newMapObject = ScriptableObject.CreateInstance <MapObject>(); string newMapObjectType = availableObjectTypes[Random.Range(0, availableObjectTypes.Count)]; newMapObject.SetupMapObject(newMapObjectType); availableObjectTypes.Remove(newMapObjectType); mapObjects.Add(newMapObject); objectsToSpawn--; } } }