// Update is called once per frame
        private void Update()
        {
            UpdateTimers();
            //Incase of animation rotations
            transform.rotation = _baseRotation;
            if (!Data.IsDragged() && (!_animator.GetCurrentAnimatorStateInfo(0).IsName("Havalan") &&
                                      !_animator.GetCurrentAnimatorStateInfo(0).IsName("Havalan 0") &&
                                      !_animator.GetCurrentAnimatorStateInfo(0).IsName("Havalan 1")))
            {
                transform.position = _basePosition;
            }

            var tower = _building as Tower;

            //var _shrine = _building as Shrine;

            // Cast spell with delay
            if (tower && Data.IsActive() && Time.time > _spellTime)
            {
                var minionToHit = FindFirstMinion();
                if (minionToHit && Time.timeScale != 0)
                {
                    _spellTime = Data.NextSpellTime() + (Data.GetDelay() * ((float)delayMultiplier - 1));
                    var pos = _building.transform.Find("SpellSpawn").transform.position;
                    //pos.y = 20;
                    Spell.Clone(Player, ElementController.Instance.GetParticle(Data.GetElement()), Data.GetSpellData(), pos, minionToHit, this, damageMultiplier);
                    Player._audioManager.PlaySpellCastingSound(Data.GetElement());
                }
            }

            UpdateAutoUpgrade();

            if (Data.IsDragged())
            {
                if (Input.GetMouseButtonUp(0))
                {
                    ReleaseDraggedMage();
                }
                else
                {
                    DragMageWithMouse();
                }
            }

            if (Data.GetPrefabId() != PrefabId)
            {
                Player.UpdateMagePrefab(this);
            }
        }