Example #1
0
 public void CancelSkillCall()
 {
     UIManager.SkillCancelButton.SetActive(false);
     SkillManager.StopAnimations();
     _skillMage = null;
     Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
 }
Example #2
0
        public virtual bool SetMageInside(Mage mage)
        {
            if (InsideMage)
            {
                return(false);
            }
            InsideMage = mage;

            ParticleEffect.startColor = ElementController.Instance.GetColor(mage.Data.GetElement());
            ParticleEffect.Play();
            Crystal.gameObject.SetActive(true);

            var texture = ElementController.Instance.GetTower(mage.Data.GetElement());

            Crystal.GetComponent <Renderer>().material.mainTexture = texture;

            for (var i = 0; i < Banner.Length; i++)
            {
                if (Banner[i])
                {
                    Banner[i].SetActive(true);
                    Banner[i].GetComponent <Renderer>().material.mainTexture =
                        ElementController.Instance.GetShrine(mage.Data.GetElement());
                    //Works with old function gor shrines
                }
            }
            return(true);
        }
Example #3
0
 public void SkillCall(Mage mage)
 {
     _skillMage = mage;
     UIManager.SkillCancelButton.SetActive(true);
     SkillManager.ExitSkillCancel();
     Cursor.SetCursor(SkillAimCursor, Vector2.zero, CursorMode.Auto);
     SkillManager.CallSkill(mage);
 }
Example #4
0
        public void UpdateMagePrefab(Mage mage)
        {
            var id = Data.GetMages().ToList().FindIndex(m => m == mage);

            if (id != -1)
            {
                var newMage = Data.RecreateMage(id, _mageFactory, _sceneReferenceManager.AllAssignableBuildings);
                newMage.Initialize(this);
                MageButtons.OnMagePrefabUpdated(newMage);
            }
        }
Example #5
0
        // public static AllMinionsSkillProjectile Clone(SkillProjectile skillPrefab, Mage mage, Vector3 position, GameObject target, bool isAnimation)
        public static T Clone <T>(SkillProjectile skillPrefab, Mage mage, Vector3 position, GameObject target, Vector3 targetPosition) where T : SkillProjectile
        {
            var skillProjectile = (T)GetPoolable(skillPrefab);

            skillProjectile.transform.position = position;
            skillProjectile.transform.rotation = Quaternion.identity;
            skillProjectile._data           = mage.Data.GetSkillData();
            skillProjectile._player         = mage.Player;
            skillProjectile._target         = target;
            skillProjectile._targetPosition = targetPosition;
            skillProjectile.doneEffects     = false;
            // skillProjectile._isAnimation = isAnimation;
            return(skillProjectile);
        }
Example #6
0
        public static Mage Clone(Mage magePrefab, MageData data, Vector3 position, Quaternion rotation)
        {
            var mage = (Mage)Instantiate(magePrefab, position, Quaternion.Euler(0, 90, 0));

            mage.Data = data;
            foreach (var r in mage.gameObject.GetComponentsInChildren <Renderer>())
            {
                if (r.name.Contains("Body"))
                {
                    r.material.mainTexture = ElementController.Instance.GetMage(mage.Data.GetElement())[0];
                }
                else
                {
                    r.material.mainTexture = ElementController.Instance.GetMage(mage.Data.GetElement())[1];
                }
            }
            return(mage);
        }
Example #7
0
        public virtual bool EjectMageInside()
        {
            if (!InsideMage)
            {
                return(false);
            }
            InsideMage = null;

            ParticleEffect.Stop();
            Crystal.gameObject.SetActive(false);

            foreach (GameObject banner in Banner)
            {
                banner.SetActive(false);
            }

            return(true);
        }
Example #8
0
 public void CopyAutoUpgradeTimers(Mage other)
 {
     _startedUpgrading = other.IsStartedUpgrading();
     _lastUpgradeTime  = other.GetLastUpgradeTime();
 }
        public static void Clone(Player player, Spell playerSpellPrefab, SpellData data, Vector3 position, Minion targetMinion, Mage masterMage, double damageMultiplier = 1.0)
        {
            Spell spell = (Spell)GetPoolable(playerSpellPrefab);

            spell.Player             = player;
            spell.transform.position = position;
            spell.transform.rotation = Quaternion.identity;
            spell._data             = data;
            spell._damageMultiplier = damageMultiplier;
            spell.TargetMinion      = targetMinion;
        }