Exemplo n.º 1
0
    public override void activate(bool canUse)
    {
        if (destroyGO != null)
        {
            DestroyImmediate(destroyGO);
        }
        destroyGO      = Instantiate(powerUpBlock, powerUpButton.position, Quaternion.identity) as GameObject;
        destroyGO.name = "DestroyPowerUp";
        destroyGO.transform.position   = new Vector3(powerUpButton.position.x, powerUpButton.position.y, 0);
        destroyGO.transform.localScale = new Vector3(4, 4, 4);

        bombInput.enabled = true;
        bombInput.setCurrentSelected(destroyGO);
        bombInput.OnDrop += powerUpPositioned;
        this.canUse       = canUse;

        destroyGO.GetComponentInChildren <SpriteRenderer> ().sortingLayerName = "Selected";
        updateDragableObjectImage(destroyGO);

        HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.DESTROY_POWERUP);

        if (AudioManager.GetInstance())
        {
            AudioManager.GetInstance().Play("ray");
        }
    }
Exemplo n.º 2
0
    public override void activate(bool canUse)
    {
        if (bombGO != null)
        {
            DestroyImmediate(bombGO);
        }
        bombGO      = Instantiate(powerUpBlock, powerUpButton.position, Quaternion.identity) as GameObject;
        bombGO.name = "BombPowerUp";
        bombGO.transform.position = new Vector3(powerUpButton.position.x, powerUpButton.position.y, 0);
        bombGO.GetComponentInChildren <SpriteRenderer> ().sortingLayerName = "Selected";

        bombInput.enabled = true;
        bombInput.setCurrentSelected(bombGO);
        bombInput.OnDrop         += powerUpPositioned;
        bombInput.OnCellSelected += onOverCellChanged;
        this.canUse = canUse;

        updateDragableObjectImage(bombGO);

        HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.BOMB_POWERUP);

        if (AudioManager.GetInstance())
        {
            AudioManager.GetInstance().Play("bomb");
        }
    }
Exemplo n.º 3
0
 protected void completePowerUpNoGems()
 {
     inputBlockPowerUp.enabled = false;
     //inputBlockPowerUp.gameObject.SetActive(false);
     HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.SQUARE_POWERUP);
     OnCompletedNoGems();
 }
Exemplo n.º 4
0
    public override void activate(bool canUse)
    {
        if (powerUpGO != null)
        {
            DestroyImmediate(powerUpGO);
        }
        powerUpGO      = Instantiate(powerUpBlock, powerUpButton.position, Quaternion.identity) as GameObject;
        powerUpGO.name = "WordHintPowerUp";
        powerUpGO.transform.position = new Vector3(powerUpButton.position.x, powerUpButton.position.y, 0);
        powerUpGO.GetComponentInChildren <SpriteRenderer> ().sortingLayerName = "Selected";

        powerUpInput.enabled = true;
        powerUpInput.setCurrentSelected(powerUpGO);
        powerUpInput.OnDrop += powerUpPositioned;
        this.canUse          = canUse;

        updateDragableObjectImage(powerUpGO);

        if (wordManager.checkIfAWordIsPossible(gameManager.getGridCharacters()))
        {
            canActivate = true;
            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.WORD_HINT);
        }
        else
        {
            canActivate = false;
        }
    }
Exemplo n.º 5
0
 public override void cancel()
 {
     inputBlockPowerUp.enabled = false;
     //inputBlockPowerUp.gameObject.SetActive(false);
     HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.SQUARE_POWERUP);
     OnCancel();
 }
Exemplo n.º 6
0
    public void onOverCellChanged(Cell cellSelected)
    {
        if (cellSelected != null)
        {
            if (highLightCell == null)
            {
                highLightCell = cellSelected;
            }

            if (cellSelected.contentColor != highLightCell.contentColor)
            {
                HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_SPECIFIC_COLOR);
            }


            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.BOMB_SPECIFIC_COLOR, cellSelected);
            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_POWERUP);

            highLightCell = cellSelected;
        }
        else
        {
            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.BOMB_POWERUP);
            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_SPECIFIC_COLOR);
        }
    }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     gareManager  = GameObject.Find("GaresManager").GetComponent <GaresManager>();
     hlManager    = GameObject.Find("HighLightManager").GetComponent <HighLightManager>();
     phys_buttons = GameObject.Find("CameraFilmingScene/Canvas").GetComponent <Physical_Buttons_Management>();
     meteoCamera  = GameObject.Find("2DWeather");
 }
Exemplo n.º 8
0
    protected void completePowerUp()
    {
        powerUpInput.enabled = false;
        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WILDCARD_POWERUP);

        gameManager.updatePiecesLightAndUpdateLetterState();
        OnComplete();
    }
Exemplo n.º 9
0
    public virtual void offHilight()
    {
        HighLightManager hMgr = GetComponent <HighLightManager>();

        if (hMgr != null)
        {
            hMgr.setHighLight(false);
        }
    }
Exemplo n.º 10
0
    protected void completePowerUp()
    {
        inputBlockPowerUp.enabled = false;
        //inputBlockPowerUp.gameObject.SetActive(false);
        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.SQUARE_POWERUP);

        gameManager.updatePiecesLightAndUpdateLetterState();
        OnComplete();
    }
Exemplo n.º 11
0
    public override void activate(bool canUse)
    {
        powerUpInput.enabled = true;

        powerUpInput.createBlock(powerUpBlock, powerUpButton.position, canUse);

        updateDragableObjectImage(powerUpInput.getCurrentSelected());

        HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.WILDCARD_POWERUP);
    }
Exemplo n.º 12
0
    public void cancelHinting()
    {
        cancelHint = true;
        updateGridLettersState(hintedLetters, EWordState.WORDS_AVAILABLE);
        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.SPECIFIC_CELL);

        for (int i = 0; i < hintedLetters.Count; i++)
        {
            hintedLetters [i].hinted = false;
        }
    }
Exemplo n.º 13
0
    public override void activate(bool canUse)
    {
        inputBlockPowerUp.enabled = true;
        //inputBlockPowerUp.gameObject.SetActive(true);

        inputBlockPowerUp.createBlock(powerUpBlock, powerUpButton.position, canUse);

        updateDragableObjectImage(inputBlockPowerUp.getCurrentSelected());
        inputBlockPowerUp.setPieceColor();

        HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.SQUARE_POWERUP);
    }
Exemplo n.º 14
0
    public override void cancel()
    {
        destroyGO.transform.DOMove(new Vector3(powerUpButton.position.x, powerUpButton.position.y, 1), .2f).SetId("DestroyPowerUP_Move");
        destroyGO.transform.DOScale(new Vector3(0, 0, 0), .2f).SetId("DestroyPowerUP_Scale").OnComplete(() => {
            DestroyImmediate(destroyGO);
        });

        bombInput.OnDrop -= powerUpPositioned;
        bombInput.enabled = false;

        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.DESTROY_POWERUP);

        OnCancel();
    }
Exemplo n.º 15
0
    public void onCompletedNoGems()
    {
        powerUpGO.transform.DOMove(new Vector3(powerUpButton.position.x, powerUpButton.position.y, 1), .2f).SetId("BombPowerUP_Move");
        powerUpGO.transform.DOScale(new Vector3(0, 0, 0), .2f).SetId("BombPowerUP_Scale").OnComplete(() => {
            DestroyImmediate(powerUpGO);
        });

        powerUpInput.OnDrop -= powerUpPositioned;
        powerUpInput.enabled = false;

        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WORD_HINT);

        OnCompletedNoGems();
    }
Exemplo n.º 16
0
    public void onCompletedNoGems()
    {
        bombGO.transform.DOMove(new Vector3(powerUpButton.position.x, powerUpButton.position.y, 1), .2f).SetId("BombPowerUP_Move");
        bombGO.transform.DOScale(new Vector3(0, 0, 0), .2f).SetId("BombPowerUP_Scale").OnComplete(() => {
            DestroyImmediate(bombGO);
        });

        bombInput.OnDrop -= powerUpPositioned;
        bombInput.enabled = false;

        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_POWERUP);
        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_SPECIFIC_COLOR);

        OnCompletedNoGems();
    }
Exemplo n.º 17
0
    IEnumerator updateLetterHintState(List <Letter> gridLetter)
    {
        yield return(new WaitForSeconds(0));

        cancelHint = false;
        for (int i = 0; i < gridLetter.Count; i++)
        {
            yield return(new WaitForSeconds(0.4f));

            if (!cancelHint && gridLetter[i] != null)
            {
                //gridLetter [i].updateState (Letter.EState.NORMAL);

                //HighLightManager.GetInstance ().setHighLightOfType (HighLightManager.EHighLightType.SPECIFIC_CELL,cellSelected.transform);
                gridLetter[i].transform.DOShakePosition(0.5f);

                gridLetter [i].hinted = true;
                gridLetter [i].updateState(Letter.EState.HINTED);
                if (AudioManager.GetInstance())
                {
                    AudioManager.GetInstance().Stop("helpLetterSuggested");
                    AudioManager.GetInstance().Play("helpLetterSuggested");
                }

                yield return(new WaitForSeconds(0.4f));
            }
        }
        yield return(new WaitForSeconds(0.4f));


        if (!cancelHint)
        {
            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.SPECIFIC_CELL);
            currentWordPosibleState = EWordState.HINTED_WORDS;
            for (int i = 0; i < gridLetter.Count; i++)
            {
                gridLetter [i].hinted = false;
            }
            updateGridLettersState(gridLetter, EWordState.WORDS_AVAILABLE);

            updateGridLettersState(gridLetter, EWordState.HINTED_WORDS);
        }
    }
Exemplo n.º 18
0
    public void powerUpPositioned()
    {
        bool    activated = false;
        Vector3 v3        = new Vector3();

        v3 = powerUpGO.transform.position;
        v3 = Camera.main.WorldToScreenPoint(v3);

        v3.x = v3.x / Screen.width;

        if (v3.x > piecesPanel.anchorMin.x && v3.x < piecesPanel.anchorMax.x)
        {
            v3.y = v3.y / Screen.height;
            if (v3.y > piecesPanel.anchorMin.y && v3.y < piecesPanel.anchorMax.y)
            {
                activated = true;
            }
        }
        //print ("powerUpPositioned "+ activated);
        if (!activated)
        {
            powerUpGO.transform.DOMove(new Vector3(powerUpButton.position.x, powerUpButton.position.y, 1), .2f).SetId("RotatePowerUP_Move");
            powerUpGO.transform.DOScale(new Vector3(0, 0, 0), .2f).SetId("RotatePowerUP_Scale").OnComplete(() => {
                DestroyImmediate(powerUpGO);
                cancel();
            });
        }
        else
        {
            if (!canUse)
            {
                powerUpGO.transform.DOMove(new Vector3(powerUpButton.position.x, powerUpButton.position.y, 1), .2f).SetId("RotatePowerUP_Move");
            }

            powerUpGO.transform.DOScale(new Vector3(0, 0, 0), .2f).SetId("RotatePowerUP_Scale").OnComplete(() => {
                DestroyImmediate(powerUpGO);
                powerUpActivateRotate(canUse);
            });
        }
        inputPowerUp.OnDrop -= powerUpPositioned;
        HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.ROTATE_POWERUP);
    }
Exemplo n.º 19
0
    public void powerUpPositioned()
    {
        bombInput.OnCellSelected -= onOverCellChanged;
        Cell cellSelected = cellsManager.getCellUnderPoint(bombGO.transform.position);

        if (AudioManager.GetInstance())
        {
            AudioManager.GetInstance().Stop("bomb");
        }

        if (cellSelected != null)
        {
            if (cellSelected.contentType == Piece.EType.PIECE && cellSelected.occupied)
            {
                if (canUse)
                {
                    StartCoroutine(bombAnimation.startSameColorSearchAnimation(cellSelected));
                    DestroyImmediate(bombGO);
                    bombInput.OnDrop -= powerUpPositioned;
                    bombInput.enabled = false;

                    HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_POWERUP);
                    HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.BOMB_SPECIFIC_COLOR);

                    OnComplete();
                }
                else
                {
                    onCompletedNoGems();
                }
            }
            else
            {
                cancel();
            }
        }
        else
        {
            cancel();
        }
    }
Exemplo n.º 20
0
    public void powerUpPositioned()
    {
        Cell cellSelected = cellsManager.getCellUnderPoint(destroyGO.transform.position);

        if (AudioManager.GetInstance())
        {
            AudioManager.GetInstance().Stop("ray");
        }

        if (cellSelected != null)
        {
            if (cellSelected.contentType == Piece.EType.PIECE && cellSelected.occupied)
            {
                if (canUse)
                {
                    StartCoroutine(destroyAnim.destroyColorSearchAnimation(cellSelected));
                    DestroyImmediate(destroyGO);
                    bombInput.OnDrop -= powerUpPositioned;
                    bombInput.enabled = false;

                    HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.DESTROY_POWERUP);

                    OnComplete();
                }
                else
                {
                    onCompletedNoGems();
                }
            }
            else
            {
                cancel();
            }
        }
        else
        {
            cancel();
        }
    }
Exemplo n.º 21
0
    public void powerUpPositioned()
    {
        Cell cellSelected = cellsManager.getCellUnderPoint(powerUpGO.transform.position);

        if (cellSelected != null && canActivate)
        {
            if (cellSelected.cellType != Cell.EType.EMPTY_VISIBLE_CELL && cellSelected.cellType != Cell.EType.EMPTY)
            {
                if (canUse)
                {
                    //HACE
                    gameManager.useHintWord(true);
                    DestroyImmediate(powerUpGO);
                    powerUpInput.OnDrop -= powerUpPositioned;
                    powerUpInput.enabled = false;
                    HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WORD_HINT);
                    if (AudioManager.GetInstance())
                    {
                        AudioManager.GetInstance().Stop("helpPositonated");
                        AudioManager.GetInstance().Play("helpPositonated");
                    }
                    OnComplete();
                }
                else
                {
                    onCompletedNoGems();
                }
            }
            else
            {
                cancel();
            }
        }
        else
        {
            cancel();
        }
    }
Exemplo n.º 22
0
    public override bool canMoveToNextPhase()
    {
        phaseEvent.Clear();

        switch (phase)
        {
        case (0):
            phasesPanels [0].SetActive(true);
            phaseEvent.Add(ENextPhaseEvent.POSITIONATE_PIECE);

            firstAnim();

            currentInstruction    = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV1_PHASE1);
            instructionsText      = instructions [0];
            instructionsText.text = currentInstruction;

            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.PIECES_AREA);
            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.EMPTY_CELLS);

            doAnimation = true;
            Invoke("powerUpAnim", 1);

            //Invoke ("writeLetterByLetter", initialAnim * 2);

            activateMask();

            phase = 1;
            return(true);

        case (1):
            phasesPanels [0].SetActive(false);

            deactivateMask();
            return(true);
        }

        return(base.canMoveToNextPhase());
    }
Exemplo n.º 23
0
    public override void activate(bool canUse)
    {
        this.gameObject.SetActive(true);
        if (powerUpGO != null)
        {
            DestroyImmediate(powerUpGO);
        }
        powerUpGO      = Instantiate(powerUpBlock, powerUpButton.position, Quaternion.identity) as GameObject;
        powerUpGO.name = "RotatePowerUp";
        powerUpGO.transform.position   = new Vector3(powerUpButton.position.x, powerUpButton.position.y, 0);
        powerUpGO.transform.localScale = new Vector3(4, 4, 4);
        powerUpGO.GetComponentInChildren <SpriteRenderer> ().sortingLayerName = "Selected";
        inputPowerUp.enabled = true;
        inputPowerUp.setCurrentSelected(powerUpGO);
        inputPowerUp.OnDrop += powerUpPositioned;

        inputWords.allowInput = true;
        this.canUse           = canUse;

        updateDragableObjectImage(powerUpGO);

        HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.ROTATE_POWERUP);
    }
Exemplo n.º 24
0
 public override void cancel()
 {
     powerUpInput.enabled = false;
     HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WILDCARD_POWERUP);
     OnCancel();
 }
Exemplo n.º 25
0
 protected void completePowerUpNoGems()
 {
     powerUpInput.enabled = false;
     HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WILDCARD_POWERUP);
     OnCompletedNoGems();
 }
Exemplo n.º 26
0
    public override bool canMoveToNextPhase()
    {
        phaseEvent.Clear();

        switch (phase)
        {
        case (0):
            phasesPanels [0].SetActive(true);
            previousPhase = 0;
            phaseEvent.Add(ENextPhaseEvent.CREATE_A_LINE);

            firstAnim();

            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.PIECES_AREA);

            currentInstruction    = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV3_PHASE1);
            instructionsText      = instructions [0];
            instructionsText.text = currentInstruction;

            doAnimation = true;
            Invoke("powerUpAnim", 1);

            //Invoke ("writeLetterByLetter", initialAnim * 2);

            activateMask();

            phase = 1;
            return(true);

        case (1):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [0].SetActive (false);
             * phasesPanels [1].SetActive (true);*/
            previousPhase = 0;
            currentPhase  = 1;
            phaseEvent.Add(ENextPhaseEvent.ALL_PIECES_USED);

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.PIECES_AREA);

            currentInstruction    = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV3_PHASE2);
            instructionsText      = instructions [1];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();

            doAnimation = false;

            //Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            phase = 2;
            return(true);

        case (2):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [1].SetActive (false);
             * phasesPanels [2].SetActive (true);*/
            previousPhase = 1;
            currentPhase  = 2;
            phaseEvent.Add(ENextPhaseEvent.WILDCARD_USED);

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WORD_HINT_BUTTON);

            currentInstruction    = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV3_PHASE3);
            instructionsText      = instructions [2];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();

            //Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            isWaitingForText = true;
            Invoke("OnWritingFinished", shakeDuraion * 1.5f);

            phase       = 3;
            doAnimation = false;
            return(true);

        case (3):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [2].SetActive (false);
             * phasesPanels [3].SetActive (true);*/
            previousPhase = 2;
            currentPhase  = 3;
            phaseEvent.Add(ENextPhaseEvent.POSITIONATE_PIECE);

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            currentInstruction    = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV3_PHASE4);
            instructionsText      = instructions [3];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();

            //Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            phase       = 4;
            doAnimation = false;
            return(true);

        case (4):
            phasesPanels [3].SetActive(false);

            deactivateMask();
            return(true);
        }

        return(base.canMoveToNextPhase());
    }
Exemplo n.º 27
0
    protected virtual void updateColor()
    {
        Color temp = Color.white;

        //Image tempImg = null;
        //SpriteRenderer tempSpt = null;

        //HACK revisar

        /*if (particles != null)
         * {
         *      //borderStars.SetActive (true);
         *      particles.Play();
         * }*/

        //Obtenemos el color desde el manager dependiendo del tipo
        switch (suscribedStatus[suscribedStatus.Count - 1])
        {
        case (HighLightManager.EHighLightStatus.NORMAL):
            temp = HighLightManager.GetInstance().normalHighLight;
            break;

        case (HighLightManager.EHighLightStatus.WRONG):
            temp = HighLightManager.GetInstance().wrongHighLight;
            //HACK revisar

            /*if (particles != null)
             * {
             *      //borderStars.SetActive (false);
             *      particles.Clear();
             *      particles.Stop();
             * }*/
            break;

        case (HighLightManager.EHighLightStatus.HINT):
            temp = HighLightManager.GetInstance().hintHighLight;
            break;
        }

        //Asignamos el color dependiendo si es de canvas o de sprite normal
        if (image != null)
        {
            image.color = temp;
        }

        if (sprite_renderer)
        {
            sprite_renderer.color = temp;
        }

        /*tempImg = gameObject.GetComponent<Image>();
         *
         * if (tempImg != null)
         * {
         *      tempImg.color = temp;
         * }
         * else
         * {
         *      tempSpt = gameObject.GetComponent<SpriteRenderer> ();
         *      if (tempSpt != null)
         *      {
         *              tempSpt.color = temp;
         *      }
         * }*/

        if (!isScaled)
        {
            setScale();
        }
    }
Exemplo n.º 28
0
    public override bool canMoveToNextPhase()
    {
        phaseEvent.Clear();

        switch (phase)
        {
        case (0):
            phasesPanels [0].SetActive(true);
            previousPhase = 0;
            phaseEvent.Add(ENextPhaseEvent.DESTROY_USED);

            freeDestroy = true;

            firstAnim();

            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.DESTROY_BUTTON);

            currentInstruction = MultiLanguageTextManager.instance.multipleReplace(
                MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV80_PHASE1),
                new string[2] {
                "{{b}}", "{{/b}}"
            }, new string[2] {
                "<b>", "</b>"
            });
            instructionsText      = instructions [0];
            instructionsText.text = currentInstruction;

            doAnimation = true;
            Invoke("powerUpAnim", 1);

            //Invoke ("writeLetterByLetter", initialAnim * 2);

            activateMask();

            disablePowerUps();

            powerUpManager.getPowerupByType(PowerupBase.EType.DESTROY).powerUpButton.gameObject.SetActive(true);

            previousParent = destroyButton.transform.parent;
            destroyButton.transform.SetParent(transform);

            layout.enabled = false;

            tutorialMask.SetActive(true);

            phase = 1;
            return(true);

        case (1):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [0].SetActive (false);
             * phasesPanels [1].SetActive (true);*/
            previousPhase = 0;
            currentPhase  = 1;
            phaseEvent.Add(ENextPhaseEvent.SUBMIT_WORD);

            freeDestroy = true;

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.DESTROY_BUTTON);

            currentInstruction = MultiLanguageTextManager.instance.multipleReplace(
                MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV80_PHASE2),
                new string[2] {
                "{{b}}", "{{/b}}"
            }, new string[2] {
                "<b>", "</b>"
            });
            instructionsText      = instructions [1];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();

            doAnimation            = false;
            inputDestroy.OnPlayer -= animationController;

            //Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            deactivateMask();

            enablePowerUps();

            tutorialMask.SetActive(false);

            destroyButton.transform.SetParent(previousParent);

            phase = 2;
            return(true);
        }

        return(base.canMoveToNextPhase());
    }
Exemplo n.º 29
0
    public override bool canMoveToNextPhase()
    {
        phaseEvent.Clear();

        switch (phase)
        {
        case (0):
            phasesPanels [0].SetActive(true);
            previousPhase = 0;
            phaseEvent.Add(ENextPhaseEvent.WILDCARD_USED);
            phaseEvent.Add(ENextPhaseEvent.WILDCARD_OVER_OBSTACLE);

            freeWildCard = true;

            firstAnim();

            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.WILDCARD_BUTTON);

            disablePowerUps();

            powerUpManager.getPowerupByType(PowerupBase.EType.WILDCARD).powerUpButton.gameObject.SetActive(true);

            currentInstruction = MultiLanguageTextManager.instance.multipleReplace(
                MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV64_PHASE1),
                new string[2] {
                "{{b}}", "{{/b}}"
            }, new string[2] {
                "<b>", "</b>"
            });
            instructionsText      = instructions [0];
            instructionsText.text = currentInstruction;

            doAnimation = true;
            Invoke("powerUpAnim", 1);

            //Invoke ("writeLetterByLetter", initialAnim * 2);

            phase = 1;
            return(true);

        case (1):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [0].SetActive (false);
             * phasesPanels [1].SetActive (true);*/
            previousPhase = 0;
            currentPhase  = 1;

            phasesPanels [1].transform.SetParent(keyBoard.transform);

            phaseEvent.Add(ENextPhaseEvent.KEYBOARD_LETER_SELECTED);

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            HighLightManager.GetInstance().turnOffHighLights(HighLightManager.EHighLightType.WILDCARD_BUTTON);

            enablePowerUps();

            freeWildCard = true;

            currentInstruction = MultiLanguageTextManager.instance.multipleReplace(
                MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV64_PHASE2),
                new string[2] {
                "{{b}}", "{{/b}}"
            }, new string[2] {
                "<b>", "</b>"
            });
            instructionsText      = instructions [1];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();

            doAnimation         = false;
            inputBomb.OnPlayer -= animationController;

            ////Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            phase = 2;
            return(true);

        case (2):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [3].SetActive (false);
             * phasesPanels [2].SetActive (true);*/
            previousPhase = 3;
            currentPhase  = 2;

            phaseEvent.Add(ENextPhaseEvent.WILDCARD_OVER_OBSTACLE);

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            HighLightManager.GetInstance().setHighLightOfType(HighLightManager.EHighLightType.WILDCARD_BUTTON);

            freeWildCard = true;

            currentInstruction = MultiLanguageTextManager.instance.multipleReplace(
                MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV64_PHASE3),
                new string[2] {
                "{{b}}", "{{/b}}"
            }, new string[2] {
                "<b>", "</b>"
            });
            instructionsText      = instructions [2];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();
            previousPhase = 2;

            //Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            phase = 3;
            return(true);

        case (3):
            //Deteniendo escritura previa
            //CancelInvoke ("writeLetterByLetter");
            isWriting = false;

            /*phasesPanels [2].SetActive (false);
             * phasesPanels [0].SetActive (false);
             * phasesPanels [3].SetActive (true);*/
            currentPhase = 3;

            phaseEvent.Add(ENextPhaseEvent.WILDCARD_USED);

            if (instructionIndex < currentInstruction.Length)
            {
                changeInstruction = true;
                foundStringTag    = false;
            }

            freeWildCard = true;

            currentInstruction = MultiLanguageTextManager.instance.multipleReplace(
                MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.TUTORIAL_LV64_PHASE4),
                new string[2] {
                "{{b}}", "{{/b}}"
            }, new string[2] {
                "<b>", "</b>"
            });
            instructionsText      = instructions [3];
            instructionsText.text = currentInstruction;
            instructionIndex      = 0;

            shakeToErrase();
            previousPhase = 3;

            doAnimation         = false;
            inputBomb.OnPlayer -= animationController;

            //Invoke ("writeLetterByLetter", shakeDuraion * 1.5f);

            phase = 1;
            return(true);
        }
        return(base.canMoveToNextPhase());
    }