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
|
||||
{
|
||||
|
@ -1,20 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public enum NavPointType
|
||||
{
|
||||
Cover,
|
||||
Direction,
|
||||
}
|
||||
|
||||
|
||||
public class NavPoint : MonoBehaviour
|
||||
{
|
||||
public Vector3 position => gameObject.transform.position;
|
||||
public Vector3 Position => gameObject.transform.position;
|
||||
public float FlagDistance { get; private set; }
|
||||
|
||||
public NavPointType navType = NavPointType.Direction;
|
||||
|
||||
[HideInInspector]
|
||||
public int? PointId;
|
||||
public int PointId = 0;
|
||||
public float DeathAttr = 0;
|
||||
public List<Vector3> EnemiesSeen = new List<Vector3>();
|
||||
//Here other attributes;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
FlagDistance = (GameObject.FindGameObjectWithTag("Flag").transform.position - position).magnitude;
|
||||
FlagDistance = (GameObject.FindGameObjectWithTag("Flag").transform.position - Position).magnitude;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName ="Game Settings", menuName = "Game/Settings", order = 51)]
|
||||
[CreateAssetMenu(fileName = "Game Settings", menuName = "Game/Settings", order = 51)]
|
||||
public class Settings : ScriptableObject
|
||||
{
|
||||
public bool IsTesting;
|
||||
@ -36,4 +36,6 @@ public class Settings : ScriptableObject
|
||||
public float DoDamageChanceInDirectPoint;
|
||||
public float DoDamageChanceInRunning;
|
||||
public float DoDamageChanceInCover;
|
||||
|
||||
public float CrouchingCoefficient;
|
||||
}
|
||||
|
@ -1,17 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
public class SettingsReader : MonoBehaviour
|
||||
{
|
||||
private static SettingsReader instance;
|
||||
public static SettingsReader Instance { get { return instance; } }
|
||||
public static SettingsReader Instance => instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
if (instance is null)
|
||||
instance = this;
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
Debug.LogError("Only 1 Instance");
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField] private Settings gameSettings;
|
||||
public Settings GetSettings { get { return gameSettings; } }
|
||||
public Settings GetSettings => gameSettings;
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Statistics : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/Misc/Statistics.cs.meta
generated
11
Assets/Scripts/Misc/Statistics.cs.meta
generated
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf3fe86787bfb0c4b8751fe495148ede
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user