Fixed nan exception

This commit is contained in:
2022-05-18 01:37:06 +07:00
parent 4132787ef8
commit 7db8dbcfcf
8 changed files with 336 additions and 15 deletions

View File

@ -56,6 +56,7 @@ public class FlagZone : MonoBehaviour
}
else if (occupAttackers > 0)
{
print("Atackers ocuppy flag");
TimeStayAttackers += Time.deltaTime;
GameManager._attackersTeam.AddGroupReward(Time.deltaTime* 0.1f);
GameManager._defendersTeam.AddGroupReward(-Time.deltaTime* 0.1f);
@ -67,6 +68,8 @@ public class FlagZone : MonoBehaviour
}
else if (occupDefenders > 0)
{
print("Defenders ocuppy flag");
GameManager._defendersTeam.AddGroupReward(+Time.deltaTime* 0.1f);
TimeStayDefenders += Time.deltaTime;
if (TimeStayDefenders > timeForWin)
{

View File

@ -15,6 +15,7 @@ public class NavPoint : MonoBehaviour
public float FlagDistance { get; private set; }
[SerializeField] public NavPointType navType;
[HideInInspector] public bool isOcuppied;
[HideInInspector] public int PointId = 0;
[HideInInspector] public float DeathAttr = 0;