예제 #1
0
    //Update is called once per frame
    void Update()
    {
        if (m_sizeInfo.GetFoodCollected() == 4)
        {
            if (m_caveLocked == true)
            {
                m_rbCaveObstacle.constraints = RigidbodyConstraints.FreezeRotationY |
                                               RigidbodyConstraints.FreezeRotationZ |
                                               RigidbodyConstraints.FreezePositionX;
                m_caveLocked = false;
            }
        }

        if (m_sizeInfo.GetFoodCollected() == 10)
        {
            if (m_buttonLocked == true)
            {
                m_rbButton.constraints = RigidbodyConstraints.FreezeRotation;
                m_buttonLocked         = false;
            }
        }

        if (m_rbButton.position.y <= 2.55)
        {
            m_elevator.SetActive(true);
        }
    }
예제 #2
0
    //Update is called once per frame
    void Update()
    {
        //Check if the button is pressed.
        if (m_rbButton.position.y <= 2.1f)
        {
            if (m_stepBlocked01 == true)
            {
                //Unlock the small block for the player by seting it active in the scene.
                m_stepBlock01.SetActive(true);
                m_stepBlocked01 = false;
            }
        }

        if (m_sizeInfo.GetFoodCollected() == 8)
        {
            if (m_stepBlocked02 == true)
            {
                //Unlocks the medium block with frozen rotation to make it easier to push around.
                m_rbStepBlock02.constraints = RigidbodyConstraints.FreezeRotation;
                m_stepBlocked02             = false;
            }
        }

        if (m_sizeInfo.GetFoodCollected() == 14)
        {
            if (m_bridgeLocked == true)
            {
                //Unlocks the plank to the player with limited movement so it does not fall of the map.
                m_rbPlank.constraints = RigidbodyConstraints.FreezePositionZ |
                                        RigidbodyConstraints.FreezeRotationX |
                                        RigidbodyConstraints.FreezeRotationY;
                m_bridgeLocked = false;
            }
        }

        if (m_sizeInfo.GetFoodCollected() == 15)
        {
            if (m_stepBlocked03 == true)
            {
                //Unlocks the large block with frozen rotation to make it easier to push around.
                m_rbStepBlock03.constraints = RigidbodyConstraints.FreezeRotation;
                m_stepBlocked03             = false;
            }
        }
    }
예제 #3
0
 // Update is called once per frame
 void Update()
 {
     m_foodCollectedText.text = "Food Collected: " + m_player.GetFoodCollected().ToString("0");
 }