示例#1
0
    public void OnTutorialClick()
    {
        if (tStage == TUTORIALSTAGE.WELCOME)
        {
            tStage = TUTORIALSTAGE.PLACE_TOPLEFT_P;
        }

        else if (tStage == TUTORIALSTAGE.OPPONENT_TURN1)
        {
            tStage = TUTORIALSTAGE.PLACE_MIDRIGHT_C;
        }

        else if (tStage == TUTORIALSTAGE.OPPONENT_TURN2)
        {
            tStage = TUTORIALSTAGE.PLACE_TOPRIGHT_C;
        }

        else if (tStage == TUTORIALSTAGE.PLACE_BOTRIGHT_P1)
        {
            tStage = TUTORIALSTAGE.PLACE_BOTRIGHT_P2;
        }

        if (AudioManager.Instance)
        {
            AudioManager.Instance.PlaySoundEvent(SOUNDID.CLICK);
        }
    }
示例#2
0
    void Update()
    {
        if (!isInit && isTutorial)
        {
            PrePlaceBoard();
            isInit = true;
        }

        // Tutorial Stages. Some are triggered by clicks in fn OnTutorialClick, some are triggered after putting a node (GridScript.cs, Special Case: Tutorials)
        if (tStage == TUTORIALSTAGE.STARTANIM)
        {
            tFrame.SetActive(false);
            if (isTutorial && GameStartAnim.Instance.GameStartAnimEnded())
            {
                tStage = TUTORIALSTAGE.WELCOME;
            }
        }
        else if (tStage == TUTORIALSTAGE.WELCOME)
        {
            tFrame.SetActive(true);
            tText_NoBtn.SetActive(false);
            //tFrame.GetComponent<RectTransform>().localPosition = new Vector3(0.0f, -40.0f, 0.0f);
            tText_Btn.GetComponent <Text>().text = "Welcome! Let's run through the basics of the game!";
        }
        else if (tStage == TUTORIALSTAGE.PLACE_TOPLEFT_P)
        {
            tButton.SetActive(false);
            tText_Btn.SetActive(false);
            tText_NoBtn.SetActive(true);
            tText_NoBtn.GetComponent <Text>().text = "See that glowing board on the big <color=green>top left</color> grid? That shows where you can place your piece. Try placing in the <color=blue>middle-right</color> box!";

            GameObject.FindGameObjectWithTag("Board").GetComponent <BoardScript>().bigGrids[0].GetComponent <BigGridScript>().grids[5].GetComponent <GridScript>().
            GetComponent <Animator>().SetTrigger("isIconPlaced");
        }
        else if (tStage == TUTORIALSTAGE.ICON_HIGHLIGHTED)
        {
            tText_NoBtn.GetComponent <Text>().text = "The first tap highlights the box. Tap on it again to <color=green>confirm</color> placement!";

            GameObject.FindGameObjectWithTag("Board").GetComponent <BoardScript>().bigGrids[0].GetComponent <BigGridScript>().grids[5].GetComponent <GridScript>().
            GetComponent <Animator>().SetTrigger("isIconPlaced");
        }
        else if (tStage == TUTORIALSTAGE.OPPONENT_TURN1)
        {
            tButton.SetActive(true);
            tText_Btn.SetActive(true);
            tText_NoBtn.SetActive(false);
            tText_Btn.GetComponent <Text>().text = "By placing your piece on the <color=green>middle-right</color> box of this grid, you've sent the opponent to the big <color=green>middle-right</color> grid!";

            //tFrame.GetComponent<RectTransform>().localPosition = new Vector3(0.0f, -80.0f, 0.0f);
        }
        else if (tStage == TUTORIALSTAGE.PLACE_MIDRIGHT_C)
        {
            tButton.SetActive(false);
            tText_Btn.SetActive(false);
            tText_NoBtn.SetActive(true);
            tText_NoBtn.GetComponent <Text>().text = "Waiting for opponent...";
        }
        else if (tStage == TUTORIALSTAGE.PLACE_BOTLEFT)
        {
            tFrame.SetActive(true);
            tButton.SetActive(false);
            tText_Btn.SetActive(false);
            tText_NoBtn.SetActive(true);
            tText_NoBtn.GetComponent <Text>().text = "The opponent has sent you to the big <color=green>bottom-left grid!</color> Win it!!";

            //tFrame.GetComponent<RectTransform>().localPosition = new Vector3(0.0f, -10.0f, 0.0f);

            GameObject.FindGameObjectWithTag("Board").GetComponent <BoardScript>().bigGrids[6].GetComponent <BigGridScript>().grids[2].GetComponent <GridScript>().
            GetComponent <Animator>().SetTrigger("isIconPlaced");
        }
        else if (tStage == TUTORIALSTAGE.OPPONENT_TURN2)
        {
            tButton.SetActive(true);
            tText_Btn.SetActive(true);
            tText_NoBtn.SetActive(false);
            tText_Btn.GetComponent <Text>().text = "Again, by placing your piece on the <color=green>top-right</color> box of this grid, you've sent the opponent to the big <color=green>top-right</color> grid!";

            //tFrame.GetComponent<RectTransform>().localPosition = new Vector3(0.0f, -50.0f, 0.0f);
        }
        else if (tStage == TUTORIALSTAGE.PLACE_TOPRIGHT_C)
        {
            tButton.SetActive(false);
            tText_Btn.SetActive(false);
            tText_NoBtn.SetActive(true);
            tText_NoBtn.GetComponent <Text>().text = "Waiting for opponent...";
        }
        else if (tStage == TUTORIALSTAGE.PLACE_BOTRIGHT_P1)
        {
            tFrame.SetActive(true);
            tButton.SetActive(true);
            tText_Btn.SetActive(true);
            tText_NoBtn.SetActive(false);
            tText_Btn.GetComponent <Text>().text = "You've been sent to the <color=green>bottom-center</color> box of the grid, which is already completed! So, you can now place <color=blue>ANYWHERE</color>!";

            //tFrame.GetComponent<RectTransform>().localPosition = new Vector3(0.0f, -15.0f, 0.0f);
        }
        else if (tStage == TUTORIALSTAGE.PLACE_BOTRIGHT_P2)
        {
            tButton.SetActive(false);
            tText_Btn.SetActive(false);
            tText_NoBtn.SetActive(true);
            tText_NoBtn.GetComponent <Text>().text = "Win this game by winning the bottom big grids!";

            GameObject.FindGameObjectWithTag("Board").GetComponent <BoardScript>().bigGrids[8].GetComponent <BigGridScript>().grids[1].GetComponent <GridScript>().
            GetComponent <Animator>().SetTrigger("isIconPlaced");
        }
        else if (tStage == TUTORIALSTAGE.WIN)
        {
            tButton.SetActive(false);
            tText_Btn.SetActive(false);
            tText_NoBtn.SetActive(true);
            tText_NoBtn.GetComponent <Text>().text = "Congratulations! You are now ready to challenge other players!";

            winCountdown -= Time.deltaTime;
            if (winCountdown <= 0.0f)
            {
                tFrame.SetActive(false);
            }

            isTutorial = false;
            GameData.current.finishedTutorial = true;
            SaveLoad.Save();
        }
    }