Esempio n. 1
0
    void Update()
    {
        // check if the playr has reached the requirements
        if (!RequirementsReached)
        {
            if (globalscripts.Gems >= OrbsRequired)
            {
                RequirementsReached = true;
                // change the door
                Door.transform.GetChild(1).gameObject.SetActive(false);
            }
        }



        // check if the button has been clicked
        if (ingametext.LevelConfirmed)
        {
            ingametext.LevelConfirmed = false;
            // start to move the camera to the new level
            cammanagement.ChangeCameraPosition(Level);

            // activate the timeline
            TimeLines.ActivateTimeLine(Level);

            // move player to new positon
            Player.transform.position = GameObject.Find("Platform " + Level.ToString())
                                        .GetComponent <PlatformProperties>().PlayerSpawn.transform.position;

            // turn off UI
            LevelSelectHolder.transform.GetChild(0).gameObject.SetActive(false);

            // continue after a time periond
            Invoke("LevelConfirmedTimed", 2f);
        }

        // check if the player has cancelled the level
        if (ingametext.LevelCancelled)
        {
            ingametext.LevelCancelled  = false;
            playermasterscript.CanMove = true;
            LevelSelectHolder.transform.GetChild(0).gameObject.SetActive(false);
        }
    }