Exemplo n.º 1
0
        public void SetUpSpellView(SpellItem spellItem, CallBack createSuccessCallBack)
        {
            ExploreManager.Instance.battlePlayerCtr.StopMoveAtEndOfCurrentStep();
            ExploreManager.Instance.battlePlayerCtr.isInEvent = true;
            ExploreManager.Instance.MapWalkableEventsStopAction();

            this.spellItem = spellItem;

            this.createSuccessCallBack = createSuccessCallBack;

            this.gameObject.SetActive(true);

            if (zoomCoroutine != null)
            {
                StopCoroutine(zoomCoroutine);
            }

            zoomCoroutine = HUDZoomIn(delegate {
                if (Application.internetReachability == NetworkReachability.NotReachable)
                {
                    pronounceNotAvalableHintText.enabled = true;
                }
                else
                {
                    pronounceNotAvalableHintText.enabled = false;
                }
            });

            StartCoroutine(zoomCoroutine);

            RefreshSpell();
        }
Exemplo n.º 2
0
        private bool CharactersEnoughToSpell()
        {
            bool canSpell = false;

            SpellItem spellItem = ExploreManager.Instance.newMapGenerator.spellItemOfCurrentLevel;

            List <char> charactersCollected = Player.mainPlayer.allCollectedCharacters;


            char[] charactersNeed = spellItem.spell.ToCharArray();


            //Debug.Log(spellItem.spell);

            if (charactersNeed.Length != charactersCollected.Count)
            {
                canSpell = false;
                return(canSpell);
            }

            for (int i = 0; i < charactersNeed.Length; i++)
            {
                char character = charactersNeed[i];

                if (charactersCollected.Contains(character))
                {
                    canSpell = true;
                    break;
                }
            }

            return(canSpell);
        }