# Asset Setup

## Package dependencies

This asset uses the netwonsoft json library for the save system. \
After importing the asset you may get following error:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd_SbVvx4HCKzyO0bX3agNdq3YG2gPSqY85jYnv98q8iBxOQZUf4rH03ZTHn9Q0mQ305vqpuknx2YORhOolF8sAztqpw_pMYY5HQ2rGQ6JDJUUrugO5xvH0E4sjlnenTP4G4FCa5w?key=cc_Cn8aGhqTGMuEEmspb992I" alt="" width="563"><figcaption></figcaption></figure>

To fix this go to the package manager and click on the + icon on the top left corner

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcU5qfmkDu1245fRADTn-AG1ZtFnBtM_CXkrebGfZPJliwG5NSEfEfpqNI21p6M37S_2X02iRY7v20SqB8HgTtztxGIw80CzFgYR4nFqGblTd_4A0ucfx8bIsODQofwag-Pi_jgcQ?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

Click on Add package by name and add `com.unity.nuget.newtonsoft-json`

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeye9IA8rnL7PYM3rS1RkSLPOnLdAZlME8dBrKh1eP19hBwhmHUcDGXPB8M2fJlX8zXYycTFJwv7KcBLOo-FbaTNvXEivRv4r_EoR_RsBF_ox0kYx1WPJioVM56BdOIdBU_J_67ew?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

Unity will then recompile and the error should be gone.

## Built-in, URP & HDRP

This asset was developed in the built-in render pipeline so it should work out of the box if you are using the same pipeline. For URP & HDRP simply navigate to the included RenderPipeline folder. Then double click on the upgrade for your render pipeline and import the upgraded assets. This will overwrite the materials and the shaders according to your used render pipeline

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0HwALtqAi_IH5jWKok-oFb3pKJPTHKl2bo8mnuAWHebPbZ6i47Ar-Pe5vrv8M73TrYm2YhOLRPxc-F2-8QE-biv8wyoVHciWeTVzYOqDiq6PrL_0SrdDWCI09a5q8dMx0YMtv?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

## Grid Placement Layer

Please locate the GameConfig in the scene, create a new Layer and assign the placement layer mask to the new layer.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeESGIsL6ZCq0_w0dGHQ5MDtYVR1tSJiJgHJxGWJnTsOXoTO_RCRKk_uIx4yUPc06olWtJOFOySkbxyzOFu8M4Gq95q7QLlRveVI_T_tuRHBNsp1AnxmUQLrEKTihKrl4rA9Wv7?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

That's basically all you need to do configure in order to start your demo scene.

## Optional - Extend the input handling boundaries

The grid placement system operates on a **separate layer** to give the user a visual feedback of where it is allowed to place objects. This means if the mouse is moving on some other object that is not on the same layer (like the grass floor), the input system won't recognize its movement and will not update the preview until you move back to the allowed grid layer. When you move back to the grid with the mouse, the preview will be updated again.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfBrS6UqSKZ_7vZlMeE7iLUbLekJH0M31x5UC1cxSkr-nmmKzhN2GCSWuvsp1x-Rga8kP5ikMS4lyDlsIHbSqROwVUyoWYdv7RwoVJzARiSqtxApFnI47NHyW18e8rbWvTNS0cu?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

If you do not want the previously described behaviour you can also directly assign your newly created layer to the floor object  so the placement system will recognize mouse movements across the whole floor (not only the defined grid). This would look something like this:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeGjmZZJJj9zWz9c4uJD57zCLxA8lDfU3pZph2ZjR6wDzKHzJsPOEr9UDkqsJJKB7tTAX3sVAn93XUL08uqMdjej8mTdpFqxHnD21g9zj9jNM6QLvTlt4nQhPRVy9qshuEMrM2D?key=cc_Cn8aGhqTGMuEEmspb992I" alt=""><figcaption></figcaption></figure>

With this you will achieve that the preview is updated according to your mouse. So you can drag the objects outside of the grid, but obviously you will not be able to place it since it is not anymore within the grid size boundary.

\\
