Exemplo n.º 1
0
 public RandomDrone(float speed, float size, DroneColor color, DroneType droneType = DroneType.BouncingDrone, float restrictedZone = 1, float coneRange = 360, float startDirection = 0,
                    IDroneMovement movementType = null) : base(speed, size, color, droneType, movementType)
 {
     _restrictedZone = restrictedZone;
     _coneRange      = coneRange;
     _startDirection = startDirection;
 }
Exemplo n.º 2
0
        private IEnumerator GenerateGreenDrones(float delay, int initialDroneCount, float speed, float size,
                                                DroneColor color, float reduceDelay, float minDelay, int droneIncrease, int maxDrones)
        {
            var droneCount = 0;

            while (true)
            {
                DroneFactory.SetPattern(new Pat360Drones(initialDroneCount + droneCount, delay, false, true, -90, 180, changeDirection: true, patternRepeats: 2),
                                        new DefaultDrone(speed, size, color), posDelegate: delegate {
                    return(new Vector3(0, 0.4f, BoundariesSLA.FlyingSla.BottomBoundary + (0.5f + 1.5f / 2)));
                });
                yield return(new WaitForSeconds(2 * delay));

                DroneFactory.SetPattern(new Pat360Drones(initialDroneCount + droneCount, delay, false, false, -90, 180, changeDirection: true, patternRepeats: 2),
                                        new DefaultDrone(speed, size, color), posDelegate: delegate {
                    return(new Vector3(0, 0.4f, BoundariesSLA.FlyingSla.TopBoundary - (0.5f + 1.5f / 2)));
                });

                yield return(new WaitForSeconds(2 * delay));

                if (delay > minDelay)
                {
                    delay -= delay * reduceDelay;
                }
                if (droneCount < maxDrones - initialDroneCount)
                {
                    droneCount += droneIncrease;
                }
            }
        }
Exemplo n.º 3
0
 public SpawnDroneData(DroneState state, float speed, float size, DroneColor color, DroneType droneType)
 {
     State     = state;
     Speed     = speed;
     Size      = size;
     Color     = color;
     DroneType = droneType;
 }
Exemplo n.º 4
0
 protected ADrone(float speed, float size, DroneColor color, DroneType droneType, IDroneMovement movementType,
                  IPattern pattern = null, IDrone spawnedDrones = null)
 {
     Speed         = speed;
     Size          = size;
     Color         = color;
     DroneType     = droneType;
     MovementType  = movementType ?? new StraightMovement();
     Pattern       = pattern;
     SpawnedDrones = spawnedDrones;
 }
Exemplo n.º 5
0
        private IEnumerator GenerateLevel4GreenDrones(float delay, int initialDroneCount, float speed, float size, DroneColor color, float reduceDelay, float minDelay, int droneIncrease, int maxDrones)
        {
            var droneCount = 0;
            while (true)
            {
                DroneFactory.SetPattern(new Pat360Drones(initialDroneCount + 2 * droneCount),
                    new DefaultDrone(speed, size, color), BoundariesSLA.FlyingSla, DroneStartPosition.GetRandomBottomSector);
                yield return new WaitForSeconds(delay);

                DroneFactory.SetPattern(new Pat360Drones(initialDroneCount + 2 * droneCount),
                    new DefaultDrone(speed, size, color), BoundariesSLA.FlyingSla, DroneStartPosition.GetRandomTopSector);
                yield return new WaitForSeconds(delay);
                if (delay > minDelay) { delay -= delay*reduceDelay; }
                if (droneCount < maxDrones) { droneCount += droneIncrease; }
            }
        }
Exemplo n.º 6
0
        private IEnumerator GenerateLevel6GreenDrones(float delay, int initialDroneCount, float speed, float size, DroneColor color,
                                                      float reduceDelay, float minDelay, int droneIncrease, int maxDrones, StartPositionDelegate posDelegate)
        {
            var droneCount = 0;

            while (true)
            {
                DroneFactory.SetPattern(new Pat360Drones(initialDroneCount + droneCount, 5f),
                                        new DefaultDrone(speed, size, color), BoundariesSLA.FlyingSla, posDelegate);
                yield return(new WaitForSeconds(delay));

                if (delay > minDelay)
                {
                    delay -= delay * reduceDelay;
                }
                if (droneCount < maxDrones - initialDroneCount)
                {
                    droneCount += droneIncrease;
                }
            }
        }
Exemplo n.º 7
0
 public DefaultDrone(float speed, float size, DroneColor color, Vector3?position = null, float direction = 0, DroneType droneType = DroneType.FlyingOneWayDrone,
                     IDroneMovement movementType = null) : base(speed, size, color, droneType, movementType)
 {
     _position  = position ?? new Vector3(0, 0.4f, 0);
     _direction = direction;
 }
Exemplo n.º 8
0
 public MineDrone(float speed, float size, DroneColor color, IPattern pattern = null, IDrone spawnedDrones = null, DroneType droneType = DroneType.FlyingBouncingMine,
                  IDroneMovement movementType = null) : base(speed, size, color, droneType, movementType, pattern, spawnedDrones)
 {
 }