Ejemplo n.º 1
0
 public IAllyUnitState CheckChangeState(AllyUnit unit, PlayManager environment)
 {
     if (Vector3.Distance(unit.GetPositionToGo(), unit.transform.position) < unit.GetRadiusStopPosition())
     {
         return(new IdleAllyUnitState());
     }
     return(null);
 }
Ejemplo n.º 2
0
    public IAllyUnitState CheckChangeState(AllyUnit unit, PlayManager environment)
    {
        if (Vector3.Distance(unit.GetPositionToGo(), unit.transform.position) > unit.GetRadiusStopPosition())
        {
            return(new MovementAllyUnitState());
        }

        if (unit.GetUnitTarget() != null)
        {
            return(new ShootingAllyUnitState());
        }
        return(null);
    }