public void AttackPlayer()
        {
            //this.AttackSpawner.AutoAttack = true;
            Attack spawnedAttack = this.AttackSpawner.SpawnAttack(GameManager.Player.transform.position);

            if (spawnedAttack != null)
            {
                spawnedAttack.transform.localScale =
                    this.AttackSpawner.AttackToSpawn.transform.localScale * 2;
                AutoDestroy autoDestroy = spawnedAttack.GetComponent <AutoDestroy>();
                if (autoDestroy != null)
                {
                    autoDestroy.TimeToLive =
                        this.AttackSpawner.AttackToSpawn.GetComponent <AutoDestroy>().TimeToLive * 2;
                }
            }
        }
        public void Update()
        {
            if (this.AutoAttack)
            {
                // Only auto-attack player if they're within attack reach.
                if (this.TargetsPlayer)
                {
                    AutoDestroy autoDestroy    = this.AttackToSpawn.GetComponent <AutoDestroy>();
                    Movement2D  attackMovement = this.AttackToSpawn.GetComponent <Movement2D>();
                    if (autoDestroy != null &&
                        attackMovement != null)
                    {
                        float timeToLive     = autoDestroy.TimeToLive;
                        float speed          = attackMovement.Speed;
                        float attackDistance = timeToLive * speed;

                        float distanceToPlayer = Vector2.Distance(
                            this.transform.position,
                            GameManager.Player.transform.position);
                        if (distanceToPlayer > attackDistance)
                        {
                            return;
                        }
                    }
                }

                Vector2 target = this.TargetsPlayer
                                     ? (Vector2)GameManager.Player.transform.position
                                     : Vector2.down;
                SpawnAttack(target);
            }

            if (this.CooldownTimer <= 0)
            {
                return;
            }

            this.CooldownTimer -= Time.deltaTime;
        }