Finally bots can die. Player to. And another fixes.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Animators.Leonid_Animator.Player;
|
||||
using Unity.MLAgents;
|
||||
using UnityEngine;
|
||||
|
||||
@ -48,7 +49,7 @@ public class GameManager : MonoBehaviour
|
||||
if ((SettingsReader.Instance.GetSettings.HasHumanAttacker == true && oppositeTeam == Team.Attackers) ||
|
||||
(SettingsReader.Instance.GetSettings.HasHumanDefender == true && oppositeTeam == Team.Defenders))
|
||||
{
|
||||
if (distToNavPoint > (currentTransform - CharacterFactory.Instance.player.transform.position).magnitude)
|
||||
if (distToNavPoint > (currentTransform - CharacterFactory.Instance.Player.transform.position).magnitude)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -64,7 +65,7 @@ public class GameManager : MonoBehaviour
|
||||
if ((SettingsReader.Instance.GetSettings.HasHumanAttacker == true && oppositeTeam == Team.Attackers) ||
|
||||
(SettingsReader.Instance.GetSettings.HasHumanDefender == true && oppositeTeam == Team.Defenders))
|
||||
{
|
||||
if ((currentTransform - CharacterFactory.Instance.player.transform.position).magnitude < SettingsReader.Instance.GetSettings.ViewDistance)
|
||||
if ((currentTransform - CharacterFactory.Instance.Player.transform.position).magnitude < SettingsReader.Instance.GetSettings.ViewDistance)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -99,9 +100,9 @@ public class GameManager : MonoBehaviour
|
||||
if ((SettingsReader.Instance.GetSettings.HasHumanAttacker == true && oppositeTeam == Team.Attackers) ||
|
||||
(SettingsReader.Instance.GetSettings.HasHumanDefender == true && oppositeTeam == Team.Defenders))
|
||||
{
|
||||
var player = CharacterFactory.Instance.player;
|
||||
var player = CharacterFactory.Instance.Player;
|
||||
if (Physics.Raycast(position,
|
||||
(player.GetComponent<MeshRenderer>().bounds.center - position).normalized,
|
||||
(player.GetComponent<CharacterLocomotion>().GetMeshCenter() - position).normalized,
|
||||
out rayHit,
|
||||
SettingsReader.Instance.GetSettings.ViewDistance))
|
||||
{
|
||||
|
@ -47,16 +47,15 @@ public class MapManager : MonoBehaviour
|
||||
var startNavPoint = _instance.IDToNavPoint[startPoint];
|
||||
var endNavPoint = _instance.IDToNavPoint[endPoint];
|
||||
float coef;
|
||||
try
|
||||
if (allDistance != 0)
|
||||
{
|
||||
coef = remainingDistance / allDistance;
|
||||
startNavPoint.DeathAttr += 1 - coef;
|
||||
endNavPoint.DeathAttr += coef;
|
||||
}
|
||||
catch (System.ArithmeticException)
|
||||
else
|
||||
{
|
||||
Debug.LogError("Path Length is zero");
|
||||
return;
|
||||
startNavPoint.DeathAttr += 1;
|
||||
}
|
||||
startNavPoint.DeathAttr += 1 - coef;
|
||||
endNavPoint.DeathAttr += coef;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user