예제 #1
0
    IEnumerator MovingIcon()
    {
        SquirrelIcon.transform.position = LastButton.transform.position + new Vector3(0, ICON_OFFSET, 0);

        FinishedMoveSquirrelIcon = false;
        MovingQueue mq = SquirrelIcon.GetComponent <MovingQueue>();

        mq.moveTo(NewButton.transform.position + new Vector3(0, ICON_OFFSET, 0), 1.0f);

        yield return(new WaitForSeconds(1.1f));

        FinishedMoveSquirrelIcon = true;
    }
    IEnumerator StartTheGamePhase1()
    {
        allLoadingDone = true;
        yield return(new WaitForSeconds(0.5f));

        // MOVE THE CAM
        MovingQueue mq = Camera.main.GetComponent <MovingQueue>();

        camMoveTime = _bubbleBoard.getMapData().MapSizeY * 0.15f;
        mq.moveTo(new Vector3(Camera.main.transform.position.x, 0, Camera.main.transform.position.z), camMoveTime);

        yield return(new WaitForSeconds(camMoveTime));

        startGamePhase1Ended = true;
        StartCoroutine(StartTheGamePhase2());
    }
    IEnumerator StartTheGamePhase2()
    {
        MovingQueue mq = Camera.main.GetComponent <MovingQueue>();

        mq.StopAllCoroutines();
        float newMoveTime = (camMoveTime - mq.TimeMoved) / 2.5f;

        mq.moveTo(new Vector3(Camera.main.transform.position.x, 0, Camera.main.transform.position.z), newMoveTime);
        yield return(new WaitForSeconds(newMoveTime));

        // READY-GO
        ReadyGoText.animation.Play("ReadyGoAppear");
        AudioHelper.CreatePlayAudioObject(BaseManager.GetInstance().sfxReadyGo);
        // =========
        yield return(new WaitForSeconds(0.5f));

        gameStarted = true;
        CreateBubbleBullet();
    }