public void randomizeShip() { int rand = Random.Range(1, 3); builder.hullID = rand; Hull hullData = Resources.Load <GameObject>("Ship_Parts/Hull/Hull " + builder.hullID).GetComponent <Hull>(); builder.armorID = hullData.allowedArmor[Random.Range(0, hullData.allowedArmor.Length)]; builder.engineID = hullData.allowedEngine[Random.Range(0, hullData.allowedEngine.Length)]; builder.weapon1ID = Random.Range(1, 2); builder.weapon2ID = Random.Range(1, 2); builder.weapon3ID = Random.Range(1, 2); builder.weapon4ID = Random.Range(1, 2); builder.changeArmor(); }
public void setSpaceship() { builder = hangar.GetComponent <hangar>().spaceship.GetComponent <Hangar_Builder>(); builder.getSpaceshipData(); builder.changeArmor(); }