top of page
cardimage18.png
TABLE OF CONTENTS

Page #

Table Of Contents .................................................................................................................................... 0

DemoScene Overview ............................................................................................................................. 1

Start Tutorial ............................................................................................................................................ 2

page 0

..................................................................

UI Components  ....................................................................................................................................... 3

DemoScene overview
1.png
2.png
1.png

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
4.png

Building Scripts

  1. ConstructionObject.cs

  2. ConstructionType.cs 

  3. 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

1.png

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

3.png

"Resources/Sprites" folder content

5.png

Hotbar Selected Construction

1.png

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

..................................................................
bottom of page