Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (iLastScoreIndex < mainScene.uiScoreTextGrp.Length)
        {
            if ((fScoreDelay -= Time.deltaTime) <= 0.00f)
            {
                fScoreDelay = GameDatas.FLOAT_SCOREBOARD_DELAY_TIMER;

                // Head -> UpperR -> UpperL -> LowerR -> LowerL
                scoreGrp[iLastScoreIndex].text.text = (mainScene.objDummy.hitCounter[iLastScoreIndex] + GameDatas.STRING_HIT);
                scoreGrp[iLastScoreIndex].ChangeSize(0.00f, 125);
                scoreGrp[iLastScoreIndex].ChangeScale(0.50f, 1.00f);

                if (mainScene.objDummy.hitCounter[iLastScoreIndex] > 10)
                {
                    scoreGrp[iLastScoreIndex].ChangeSize(0.10f, 130);
                    scoreGrp[iLastScoreIndex].text.text += "!";
                }
                else if (mainScene.objDummy.hitCounter[iLastScoreIndex] > 30)
                {
                    scoreGrp[iLastScoreIndex].ChangeSize(0.10f, 135);
                    scoreGrp[iLastScoreIndex].text.text += "!!";
                }

                ++iLastScoreIndex;
            }
        }
        else if (!bFinisherScoreShown)
        {
            bFinisherScoreShown = true;

            int iFinisherPower = (int)(mainScene.objDummy.fFinisherPower);

            finisherScoreImg.ChangeScale(0.20f, 1.00f);
            finisherScoreImg.ChangeAlpha(0.20f, 1.00f);
            finisherScoreText.text.text = iFinisherPower.ToString();
            finisherScoreText.ChangeScale(0.25f, 1.00f);

            RenewRanking(iFinisherPower);
        }
        else
        {
            // Waiting for punching...
            if (punchToMainText.text.color.a == 1.00f)
            {
                punchToMainText.ChangeAlpha(0.75f, 0.00f);
            }
            else if (punchToMainText.text.color.a == 0.00f)
            {
                punchToMainText.ChangeAlpha(0.50f, 1.00f);
            }

            if (inputMgr.CheckInputs())
            {
                FinishState();
            }
        }

        inputMgr.InitInputs();
    }
Example #2
0
    public bool Initialization()
    {
        bool bNoError = true;

        if (mainScene == null)
        {
            mainScene = GameObject.Find("Main Game").GetComponent <MainScene>();
        }
        if (mainScene == null)
        {
            bNoError &= false;
        }

        mainScene.HideAllUI();
        mainScene.ShowUI(0);
        uiInsertCoin        = mainScene.uiGrp[0].transform.FindChild("Insert Coin Image").FindChild("Insert Coin Text").GetComponent <TransText>();
        uiInsertCoinOutline = uiInsertCoin.gameObject.GetComponent <Outline>();
        uiRanking           = mainScene.uiGrp[0].transform.FindChild("Ranking Image").GetComponent <TransImage>();
        uiRanking.SetPosition(new Vector3(0.00f, 32.00f, 0.00f), 1000.0f);
        uiRanking.GetComponent <Ranking>().RenewRankingScore();
        uiMainTitle = mainScene.uiGrp[0].transform.FindChild("Main Title Image").GetComponent <TransImage>();
        uiMainTitle.ChangeAlpha(1.00f, 1.00f);
        fDemoAnimPlayTime = Random.Range(GameDatas.FLOAT_DEMO_ANIMPLAY_DELAY_MIN, GameDatas.FLOAT_DEMO_ANIMPLAY_DELAY_MAX);
        bNextState        = false;

        return(bNoError);
    }
Example #3
0
    public override void FinishState()
    {
        bNextState = true;

        blackFadeoutImg.ChangeAlpha(0.33f, 1.00f);

        Invoke("ChangeNextState", 0.50f);
    }
Example #4
0
    public override void FinishState()
    {
        if (mainScene.GetCoin() > 0 && inputMgr.CheckInputs())
        {
            bNextState = true;

            uiMainTitle.ChangeAlpha(0.50f, 0.00f);
            uiInsertCoin.ChangeAlpha(0.50f, 0.00f);
            uiInsertCoinOutline.effectColor = new Color(uiInsertCoinOutline.effectColor.r, uiInsertCoinOutline.effectColor.g, uiInsertCoinOutline.effectColor.b, 0.00f);
            uiRanking.SetPosition(new Vector3(0.00f, -500.0f, 0.00f), 1000.0f);
            mainScene.SubCoin();

            Invoke("ChangeNextState", 0.50f);
        }
    }
Example #5
0
    public override void FinishState()
    {
        bNextState = true;

        mainTitle.SetPosition(new Vector3(0.00f, 1000.0f, 0.00f), 1000.0f);
        leftHand.SetPosition(new Vector3(-200.00f, 0.00f, 0.00f), 1000.0f);
        rightHand.SetPosition(new Vector3(200.00f, 0.00f, 0.00f), 1000.0f);
        selectHelp.SetPosition(new Vector3(500.0f, 32.0f, 0.00f), 1000.0f);

        mainTitle.ChangeAlpha(0.50f, 0.00f);
        leftHand.ChangeAlpha(0.50f, 0.00f);
        rightHand.ChangeAlpha(0.50f, 0.00f);
        selectHelp.ChangeAlpha(0.50f, 0.00f);

        Invoke("ChangeNextState", 0.50f);
    }
Example #6
0
    public bool Initialization()
    {
        bool bNoError = true;

        if (mainScene == null)
        {
            mainScene = GameObject.Find("Main Game").GetComponent <MainScene>();
        }
        if (mainScene == null)
        {
            bNoError &= false;
        }

        enSubState = SubState.STATE_READY;

        mainScene.HideAllUI();
        mainScene.ShowUI(2);

        bFinisherState       = false;
        fStartDelayTime      = GameDatas.FLOAT_GAMESTART_DELAY_TIMER;
        fEndDelayTime        = 5.00f;
        startDelayImageShown = new bool[mainScene.sprite_startDelayGrp.Length];
        startDelayImageGrp   = new Sprite[mainScene.sprite_startDelayGrp.Length];
        for (int i = 0; i < mainScene.sprite_startDelayGrp.Length; ++i)
        {
            startDelayImageShown[i] = false;
            startDelayImageGrp[i]   = mainScene.sprite_startDelayGrp[i];
        }

        Transform uiTrans = mainScene.uiGrp[2].transform;

        mainTimer = uiTrans.FindChild("Game Timer Image").GetComponent <CountdownTimer>();
        mainTimer.timerText.ChangeAlpha(0.00f, 0.00f);
        mainTimer.timerText.ChangeAlpha(0.50f, 1.00f);
        mainTimer.fTimeLeft = GameDatas.FLOAT_NORMALPUNCH_TIMER;
        finisherImg         = uiTrans.FindChild("Finisher Image").GetComponent <TransImage>();
        finisherImg.ChangeAlpha(0.00f, 1.00f);
        finisherImg.ChangeScale(0.00f, 0.00f);

        startTimerImageTrans = uiTrans.FindChild("Start Timer Image");

        return(bNoError);
    }
Example #7
0
    public bool Initialization()
    {
        bool bNoError = true;

        if (mainScene == null)
        {
            mainScene = GameObject.Find("Main Game").GetComponent <MainScene>();
        }
        if (mainScene == null)
        {
            bNoError &= false;
        }

        mainScene.HideAllUI();
        mainScene.ShowUI(3);

        iLastScoreIndex     = 0;
        bFinisherScoreShown = false;
        fScoreDelay         = GameDatas.FLOAT_SCOREBOARD_DELAY_TIMER;

        scoreGrp = new TransText[mainScene.uiScoreTextGrp.Length];
        for (int i = 0; i < mainScene.uiScoreTextGrp.Length; ++i)
        {
            scoreGrp[i] = mainScene.uiScoreTextGrp[i];
            mainScene.uiScoreTextGrp[i].ChangeScale(0.00f, 0.00f);
        }

        scoreHead   = mainScene.uiScoreTextGrp[0];
        scoreUpperR = mainScene.uiScoreTextGrp[1];
        scoreUpperL = mainScene.uiScoreTextGrp[2];
        scoreLowerR = mainScene.uiScoreTextGrp[3];
        scoreLowerL = mainScene.uiScoreTextGrp[4];

        finisherScoreImg = mainScene.uiGrp[3].transform.FindChild("Finisher Score Image").GetComponent <TransImage>();
        finisherScoreImg.ChangeAlpha(0.00f, 0.00f);
        finisherScoreImg.ChangeScale(0.00f, 0.00f);
        finisherScoreText = finisherScoreImg.transform.FindChild("Finisher Score Text").GetComponent <TransText>();
        punchToMainText   = mainScene.uiGrp[3].transform.FindChild("Punch to Main Text").GetComponent <TransText>();
        blackFadeoutImg   = mainScene.uiGrp[3].transform.FindChild("Black Fadeout Image").GetComponent <TransImage>();

        return(bNoError);
    }
Example #8
0
    public bool Initialization()
    {
        bool bNoError = true;

        if (mainScene == null)
        {
            mainScene = GameObject.Find("Main Game").GetComponent <MainScene>();
        }
        if (mainScene == null)
        {
            bNoError &= false;
        }

        mainScene.HideAllUI();
        mainScene.ShowUI(1);
        iCurrentDummyIndex = 0;
        HideDummyAll();
        ShowDummy(iCurrentDummyIndex);

        Transform uiTrans = mainScene.uiGrp[1].transform;

        mainTitle  = uiTrans.FindChild("Main Title Image").GetComponent <TransImage>();
        leftHand   = uiTrans.FindChild("Dummy Select Image").FindChild("Left Image").GetComponent <TransImage>();
        rightHand  = uiTrans.FindChild("Dummy Select Image").FindChild("Right Image").GetComponent <TransImage>();
        selectHelp = uiTrans.FindChild("Select Help Image").GetComponent <TransImage>();

        mainTitle.SetPosition(new Vector3(0.00f, -128.0f, 0.00f), 10000.0f);
        leftHand.SetPosition(new Vector3(16.00f, 0.00f, 0.00f), 10000.0f);
        rightHand.SetPosition(new Vector3(-16.00f, 0.00f, 0.00f), 10000.0f);
        selectHelp.SetPosition(new Vector3(500.0f, 32.0f, 0.00f), 10000.0f);

        mainTitle.ChangeAlpha(0.50f, 1.00f);
        leftHand.ChangeAlpha(0.50f, 1.00f);
        rightHand.ChangeAlpha(0.50f, 1.00f);
        selectHelp.ChangeAlpha(0.50f, 1.00f);

        selectHelp.SetPosition(new Vector3(-32.00f, 32.00f, 0.00f), 3000.0f);
        return(bNoError);
    }
Example #9
0
    // Update is called once per frame
    void Update()
    {
        if (enSubState == SubState.STATE_READY)
        {
            if ((fStartDelayTime -= Time.deltaTime) <= 0.00f) // When ready state timeover
            {
                fStartDelayTime = 0.00f;
                enSubState      = SubState.STATE_PUNCH;
            }

            if (!startDelayImageShown[0] && fStartDelayTime <= 3.00f)
            {
                CreateDelayTimerImg(0);
            }
            else if (!startDelayImageShown[1] && fStartDelayTime <= 2.00f)
            {
                CreateDelayTimerImg(1);
            }
            else if (!startDelayImageShown[2] && fStartDelayTime <= 1.00f)
            {
                CreateDelayTimerImg(2);
            }
            else if (!startDelayImageShown[3] && fStartDelayTime <= 0.00f)
            {
                CreateDelayTimerImg(3);
            }
        }
        else if (enSubState == SubState.STATE_PUNCH)
        {
            if ((mainTimer.fTimeLeft -= Time.deltaTime) <= 0.00f) // When punch state timeover
            {
                mainTimer.fTimeLeft = GameDatas.FLOAT_FINISHERPUNCH_TIMER;
                enSubState          = SubState.STATE_FINISHER;

                finisherImg.ChangeAlpha(0.75f, 0.00f);
                finisherImg.ChangeScale(0.75f, 2.00f);
                fStartDelayTime = 1.50f;
            }
            else
            {
                UpdateNormalPunchState();
            }
        }
        else if (enSubState == SubState.STATE_FINISHER)
        {
            if ((mainTimer.fTimeLeft -= Time.deltaTime) <= 0.00f) // When finisher state timeover
            {
                mainTimer.fTimeLeft = 0.00f;
                enSubState          = SubState.STATE_END;
            }
            else
            {
                if (!((fStartDelayTime -= Time.deltaTime) > 0.00f))
                {
                    UpdateFinisherPunchState();
                }
            }
        }
        else
        {
            if ((fEndDelayTime -= Time.deltaTime) <= 0.00f) // When finisherdown(end) state timeover
            {
                mainTimer.timerText.ChangeAlpha(0.50f, 0.00f);
                FinishState();
            }
        }
        inputMgr.InitInputs();
    }