Fixed a bug with checking panel order and winner status.
This commit is contained in:
parent
43bed62c7e
commit
5374cc5e1d
@ -71,10 +71,12 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
else if (_HasBeenCheckedBefore[Panel - 1])
|
||||
{
|
||||
_GameManager.AlreadyTried();
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
_GameManager.NothingThere();
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
} break;
|
||||
case 1:
|
||||
@ -110,17 +112,37 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
{
|
||||
_GameManager.AlreadyTried();
|
||||
}
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
_GameManager.NothingThere();
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
} break;
|
||||
case 2:
|
||||
{
|
||||
_OrderIsCorrect[2] = (Panel == CrookLocation);
|
||||
|
||||
if (_HasBeenCheckedBefore[Panel - 1])
|
||||
if (_OrderIsCorrect[2])
|
||||
{
|
||||
if (!_OrderIsCorrect[1] || !_OrderIsCorrect[0])
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Crook);
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 2.5f);
|
||||
}
|
||||
}
|
||||
else if (Panel == LootLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Loot);
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 2.5f);
|
||||
}
|
||||
else if (Panel == WarrantLocation)
|
||||
{
|
||||
_GameManager.OutOfOrder(PanelType.Warrant);
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 2.5f);
|
||||
}
|
||||
else if (_HasBeenCheckedBefore[Panel - 1])
|
||||
{
|
||||
if (!_OrderIsCorrect[0] || !_OrderIsCorrect[1])
|
||||
{
|
||||
@ -130,10 +152,12 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
{
|
||||
_GameManager.AlreadyTried();
|
||||
}
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
_GameManager.NothingThere();
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
@ -152,17 +176,13 @@ public class LocationBoard : UdonSharpBehaviour
|
||||
//else if (Panel == CrookLocation)
|
||||
//{
|
||||
//}
|
||||
}
|
||||
|
||||
if (_OrderIsCorrect[0] && _OrderIsCorrect[1] && _OrderIsCorrect[2])
|
||||
{
|
||||
_GameManager.YoureWinner();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendCustomEventDelayedSeconds(nameof(InitiateBoardReset), 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
_HasBeenCheckedBefore[Panel - 1] = true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user