the editor script enables you to create rooms made of single wallpieces.
As you can see on the second screenshot you can define the height, length and width of the building.
You can also create own wallpieces to make your own building with the script.
The thought behind all this is, that you can replace wallpieces with windows, doors (which are coming with the package) or remove them while playing - think of a rocketlauncher which blows away wallpieces.
The webplayer shows 3 randomly generated rooms, which were modified (added doors, windows, removed some wallpieces). Those rooms are examples what you can do with the editorscript the models!
everything happens through script, which is fully included in the package. So it shouldn’t be a problem to create rooms while playing.
I will try it later this day, to make sure and let you know.
class RoomGenerator : ScriptableWizard
{
public int x = 10;
public int y = 10;
public int height = 2;
public float yWallRotationOffset = 90.0f;
public float yCornerRotationOffset = 90.0f;
public GameObject wallpiece = null;
public GameObject cornerpiece = null;
private Vector3 m_wallDimensions;
[MenuItem ("Custom/Generate Room")]
static void CreateWizard ()
{
ScriptableWizard.DisplayWizard/*<RoomGenerator>*/("Room Generator", typeof(RoomGenerator));
}
void OnWizardCreate ()
{
// .... this is where the room is built ... code was cut ;)
}
That means you would take the code out of “OnWizardCreate()” into your script’s function plus adding the member variables to your script and it will work even ingame while playing.
You mean like building it piece for piece?
Well that can’t be done with this script since it build complete rooms. But it could help you as a reference how to place single pieces while playing.