Fixes? and side channels.
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class FlagZone : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public float TimeStayAttackers { get; private set; }
|
||||
public float TimeStayDefenders { get; private set; }
|
||||
private int occupDefenders;
|
||||
@ -13,7 +13,6 @@ public class FlagZone : MonoBehaviour
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
timeForWin = SettingsReader.Instance.GetSettings.TimeToWin;
|
||||
TimeStayAttackers = 0;
|
||||
TimeStayDefenders = 0;
|
||||
@ -30,8 +29,12 @@ public class FlagZone : MonoBehaviour
|
||||
case "Attacker":
|
||||
occupAttackers++;
|
||||
break;
|
||||
default:
|
||||
print(other.tag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
switch (other.tag)
|
||||
@ -50,19 +53,32 @@ public class FlagZone : MonoBehaviour
|
||||
{
|
||||
TimeStayAttackers = 0;
|
||||
TimeStayDefenders = 0;
|
||||
return;
|
||||
}
|
||||
else if (occupAttackers > 0)
|
||||
{
|
||||
TimeStayAttackers += Time.deltaTime;
|
||||
GameManager._attackersTeam.AddGroupReward(Time.deltaTime* 0.1f);
|
||||
GameManager._defendersTeam.AddGroupReward(-Time.deltaTime* 0.1f);
|
||||
if (TimeStayAttackers > timeForWin)
|
||||
{
|
||||
GlobalEventManager.SendCaptureFlag(Team.Attackers);
|
||||
NullifyFlagCapture();
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (occupDefenders > 0)
|
||||
{
|
||||
TimeStayDefenders += Time.deltaTime;
|
||||
if (TimeStayDefenders > timeForWin)
|
||||
{
|
||||
GlobalEventManager.SendCaptureFlag(Team.Defenders);
|
||||
NullifyFlagCapture();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void NullifyFlagCapture()
|
||||
{
|
||||
TimeStayAttackers = 0;
|
||||
TimeStayDefenders = 0;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Settings : ScriptableObject
|
||||
public float DoDamageChanceInCover;
|
||||
|
||||
public int RifleDamage;
|
||||
public int RateOfFire;
|
||||
public float RateOfFire;
|
||||
|
||||
public float CrouchingCoefficient;
|
||||
|
||||
|
Reference in New Issue
Block a user