public void Update()
    {
        if (Util.PointInCircle(PlayerControler.instance.transform.position, transform.position, activeRange))
        {
            if (weapon.IsReloading())
            {
                if (isShooting)
                {
                    moveScript.WakeUp();
                    isShooting = false;
                }
            }
            else
            {
                if (!isShooting)
                {
                    if ((!fireOnlyWhenInDriectLine || !Physics2D.Linecast(weapon.GetShootingOrigin().position, PlayerControler.instance.transform.position, Factory.instance.groundMask)) &&
                        (!fireOnlyWhenLookingInRightDir || moveScript.MovingRight() == transform.position.x - PlayerControler.instance.transform.position.x < 0))
                    {
                        moveScript.Shutdown();
                        isShooting     = true;
                        shootTimeStamp = Time.time + beforeShootDelay;

                        if (onTargetLockedEffect != null)
                        {
                            GameObject go = Instantiate(onTargetLockedEffect, effectPostion);
                            go.transform.localScale *= 1 / effectPostion.lossyScale.x;
                        }
                    }
                    else
                    {
                        return;
                    }
                }

                if (Time.time >= shootTimeStamp)
                {
                    Vector2 direction = PlayerControler.instance.transform.position - transform.position;

                    weapon.Fire(((Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg) + Random.Range(-aimSpread, aimSpread)) % 360);
                }
            }
        }
        else
        {
            if (!moveScript.enabled)
            {
                moveScript.enabled = true;
            }
        }
    }