Ejemplo n.º 1
0
        public void ApplySpell(SpellStackInfo info)
        {
            switch (info.Spell)
            {
            case Spells.Maximize:
                magnifyStacks++;

                if (magnifyStacks > maxMagnifyStacks)
                {
                    magnifyStacks = maxMinimizeStacks;
                    return;
                }

                break;

            case Spells.Minimize:
                minimizeStacks++;

                if (minimizeStacks > maxMinimizeStacks)
                {
                    minimizeStacks = maxMinimizeStacks;
                    return;
                }

                break;

            default:
                Debug.LogWarning($"Attempted to pass non-resize spell {info.Spell} to Resizable script.");
                return;
            }

            stacks.Add(info);
            StartCoroutine(RemoveStack(info));
            RecalculateScale();
        }
Ejemplo n.º 2
0
        private IEnumerator RemoveStack(SpellStackInfo info)
        {
            yield return(new WaitForSeconds(info.Duration));

            stacks.Remove(info);
            DecreaseStackCount(info);
            RecalculateScale();
        }
Ejemplo n.º 3
0
        private void DecreaseStackCount(SpellStackInfo stack)
        {
            switch (stack.Spell)
            {
            case Spells.Maximize:
                magnifyStacks--;
                break;

            case Spells.Minimize:
                minimizeStacks--;
                break;
            }
        }