to new git
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
public class FlagZone : MonoBehaviour
|
||||
{
|
||||
@ -9,8 +7,8 @@ public class FlagZone : MonoBehaviour
|
||||
public float TimeStayDefenders { get; private set; }
|
||||
private int occupDefenders;
|
||||
private int occupAttackers;
|
||||
public bool isOccupBoth => (occupDefenders>0) && (occupAttackers>0);
|
||||
public bool isNotOccup => (occupDefenders == 0) && (occupAttackers == 0);
|
||||
public bool IsOccupBoth => (occupDefenders > 0) && (occupAttackers > 0);
|
||||
public bool IsNotOccup => (occupDefenders == 0) && (occupAttackers == 0);
|
||||
private float timeForWin;
|
||||
|
||||
private void Start()
|
||||
@ -24,7 +22,7 @@ public class FlagZone : MonoBehaviour
|
||||
}
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
switch(other.tag)
|
||||
switch (other.tag)
|
||||
{
|
||||
case "Defender":
|
||||
occupDefenders++;
|
||||
@ -54,7 +52,7 @@ public class FlagZone : MonoBehaviour
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (isOccupBoth || isNotOccup)
|
||||
if (IsOccupBoth || IsNotOccup)
|
||||
{
|
||||
TimeStayAttackers = 0;
|
||||
TimeStayDefenders = 0;
|
||||
@ -64,7 +62,7 @@ public class FlagZone : MonoBehaviour
|
||||
{
|
||||
TimeStayAttackers += Time.deltaTime;
|
||||
if (TimeStayAttackers > timeForWin)
|
||||
GlobalEventManager.SendCaptureFlag(Team.Attackers);
|
||||
GlobalEventManager.SendCaptureFlag(Team.Attackers);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user