TABLE OF CONTENTS
Page #
Table Of Contents .................................................................................................................................... 0
DemoScene Overview ............................................................................................................................. 1
Start Tutorial ............................................................................................................................................ 2
page 0
..................................................................
UI Components ....................................................................................................................................... 3
DemoScene overview
There is a ShowRoom to display how a finished home would look like. And also to display how and where all the constructions should be placed.
You can only place floor first to create a new structure.
So you have to place a floor first, then a wall on the floor, then a roof on the wall.
You can only place floor on floor, wall on floor, doorway on floor, pillar on floor and corner on floor.
You can only place door on doorway.
You can only place roof on wall and roof on roof.
You can only place ramp on floor and stairs on stairs.
This way if a construction does not snap, it won't be able to be instantiated. Unless you uncheck snapping checkbox.
You can add constructions to the ShowRoom or make a completely new structure nearby.
page 1
..................................................................
The "Example" prefab should also have a box collider to detects the bounds for the calculation of the snap points.
Start Tutorial
Building Scripts
-
ConstructionObject.cs
-
ConstructionType.cs
-
XrayObject.cs
-
1)The ConstructionObject scripts is to find the points to snap the xray object position.
​
-
2)The ConstructionType scripts will be on all Xray and Construction object in the Resources folder, it's used to add a type to the constructions ("roof, floor, door etc").
​
-
3)The XrayObject scripts is to spawn the ConstructionObject with it's own rotation and position.
There should be an "Example" prefab and an "Examplexray" prefab in the resources folder. The "Example" prefab should be tagged Construction and have a ConstructionObject.cs and a ConstructionType.cs. The "Examplexray" prefab should be tagged Xray and have a XrayObject.cs and a ConstructionType.cs with the same type as the "Example" ConstructionType.cs.
page 2
..................................................................
UI Components
Construction rotation debugger
The closest construction's name and rotation are displayed, as well as,
the current xray construction's name and rotation.
The Mini Inventory is filled at startup in Awake() from the "Resources/Sprites" folder content.
The scrollbar enables you to add even more object to the construction collection, rather easily.
Construction collection
"Resources/Sprites" folder content
Hotbar Selected Construction
The selected construction's icon is displayed insided the Selected slot at the far left of the hotbar.
Pressing 1-8 hover an object from the collection select a construction, press again to deselect.
page 3