to new git

This commit is contained in:
2022-05-04 23:50:07 +07:00
parent 290f5515b7
commit c8af0e5284
39 changed files with 720 additions and 359 deletions

View File

@ -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
{