Fixed courier spot width

This commit is contained in:
Dawid Pietrykowski 2022-09-10 15:44:24 +02:00
parent 40f492abae
commit 788db702cd
2 changed files with 27 additions and 9 deletions

View File

@ -532,7 +532,7 @@ Transform:
m_GameObject: {fileID: 5973527577926520298} m_GameObject: {fileID: 5973527577926520298}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 15.46, y: 1.0999985, z: 0} m_LocalPosition: {x: 15.46, y: 1.0999985, z: 0}
m_LocalScale: {x: 2.25, y: 7.5, z: 1} m_LocalScale: {x: 2.5, y: 7.5, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 5968983279822924557} - {fileID: 5968983279822924557}

View File

@ -606,11 +606,23 @@ namespace Parking
bool flipped = false; bool flipped = false;
for (int j = 0; j < spotMap[i].Count; j++) { for (int j = 0; j < spotMap[i].Count; j++) {
currentX += (i != 0 ? 1 : -1) * // currentX += (i != 0 ? 1 : -1) *
(spotMap[i][j].Perpendicular // (spotMap[i][j].Perpendicular
? 2.25f / 2.0f // ? 2.25f / 2.0f
: spotSizes[(int) spotMap[i][j].Size] / 2.0f); // : spotSizes[(int) spotMap[i][j].Size] / 2.0f);
if(spotMap[i][j].Size != Size.D)
currentX += (i != 0 ? 1 : -1) *
(spotMap[i][j].Perpendicular
? 2.25f / 2.0f
: spotSizes[(int) spotMap[i][j].Size] / 2.0f);
else
currentX += (i != 0 ? 1 : -1) *
(spotMap[i][j].Perpendicular
? 2.5f / 2.0f
: spotSizes[(int) spotMap[i][j].Size] / 2.0f);
spotMap[i][j].Flipped = flipped; spotMap[i][j].Flipped = flipped;
bool alignTop = i % 2 != 0; bool alignTop = i % 2 != 0;
spotMap[i][j].GameObject = Instantiate(prefabs[(int) spotMap[i][j].Size], mainPlanContainer); spotMap[i][j].GameObject = Instantiate(prefabs[(int) spotMap[i][j].Size], mainPlanContainer);
@ -646,10 +658,16 @@ namespace Parking
spotMap[i][j].Lane = i; spotMap[i][j].Lane = i;
currentX += (i != 0 ? 1 : -1) * if(spotMap[i][j].Size != Size.D)
(spotMap[i][j].Perpendicular currentX += (i != 0 ? 1 : -1) *
? 2.25f / 2.0f (spotMap[i][j].Perpendicular
: spotSizes[(int) spotMap[i][j].Size] / 2.0f); ? 2.25f / 2.0f
: spotSizes[(int) spotMap[i][j].Size] / 2.0f);
else
currentX += (i != 0 ? 1 : -1) *
(spotMap[i][j].Perpendicular
? 2.5f / 2.0f
: spotSizes[(int) spotMap[i][j].Size] / 2.0f);
flipped = !flipped; flipped = !flipped;
} }