예제 #1
0
    // --------------------------------------------
    // Update is called once per frame
    // --------------------------------------------
    void Update()
    {
        currentPos = transform.position;

        // Start mouvement
        if (currentPos.y > 0)
        {
            currentPos.y      -= 0.1f;
            transform.position = currentPos;
        }

        // If falling, destroy the floor and change bg color
        if (counter == 25)
        {
            Camera.main.backgroundColor = nextBG;
            // Camera mouvement
            Invoke("nextScene", 2f);
            // At a certain point, load next scene
            if (transform.position.y < -15f)
            {
                GM_Controller gmScript = gameMaster.GetComponent <GM_Controller> ();
                gmScript.loadThanks();
            }
        }
    }
예제 #2
0
    // --------------------------------------------
    // Update is called once per frame
    // --------------------------------------------
    void Update()
    {
        // Camera movement at the begining to show the word
        if (transform.position.y > 2.73f)
        {
            Vector3 currentPos = transform.position;
            currentPos.y      -= 0.1f;
            transform.position = currentPos;
        }
        else if (!readyForNext)
        {
            followLiteral = true;
            Pole_Controller poleScript = thePole.GetComponent <Pole_Controller>();
            poleScript.camReady();
        }

        // Avtivate the camera following
        if (followLiteral)
        {
            Vector3 Targetpos = target.transform.position;
            transform.position = new Vector3(Targetpos.x, Targetpos.y, 0f);
        }

        // Change the zoom
        if (transform.position.x > 1f)
        {
            activateZoomOut();
        }
        // Adjust the camera zoom
        Camera.main.orthographicSize = zoom;

        // When the letter C reach the finish line
        if (transform.position.x > 157f)
        {
            // Change bg color
            Camera.main.backgroundColor = nextBG;
            // Stop all movement
            readyForNext  = true;
            followLiteral = false;

            Invoke("rollToNext", 3f);
        }

        if (transform.position.x > 200f)
        {
            GM_Controller gmScript = gameMaster.GetComponent <GM_Controller> ();
            gmScript.loadHiding();
        }
    }
예제 #3
0
    // --------------------------------------------
    // Update is called once per frame
    // --------------------------------------------
    void Update()
    {
        currentPos = transform.position;

        // Start mouvement
        if (currentPos.y > 0)
        {
            currentPos.y      -= 0.1f;
            transform.position = currentPos;
        }
        else
        {
            Invoke("nextScene", 10f);
        }

        if (currentPos.y < -16f)
        {
            GM_Controller gmScript = gameMaster.GetComponent <GM_Controller> ();
            gmScript.loadFirst();
        }
    }
예제 #4
0
    // ------------------------------------------
    // Update is called once per frame
    // ------------------------------------------
    void Update()
    {
        currentPos = transform.position;

        // Start mouvement
        if (currentPos.x < 0)
        {
            currentPos.x      += 0.3f;
            transform.position = currentPos;
        }

        // Check if a letter pass the dotted line
        if (letter1.position.y < -3f ||
            letter2.position.y < -3f ||
            letter3.position.y < -3f ||
            letter4.position.y < -3f ||
            letter5.position.y < -3f ||
            letter6.position.y < -3f &&
            !falling)
        {
            falling = !falling;
        }

        // If falling, destroy the floor and change bg color
        if (falling)
        {
            Destroy(theFloor);
            Camera.main.backgroundColor = nextBG;
            // Camera mouvement
            Invoke("nextScene", 4f);

            // At a certain point, load next scene
            if (transform.position.y < -20f)
            {
                GM_Controller gmScript = gameMaster.GetComponent <GM_Controller> ();
                gmScript.loadTower();
            }
        }
    }
예제 #5
0
    // -------------------

    void nextScene()
    {
        GM_Controller gmScript = gameMaster.GetComponent <GM_Controller> ();

        gmScript.loadLiquid();
    }