// Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         levelchanger.FadeToNextLevel();
     }
 }
Ejemplo n.º 2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         levelChangerHandle.FadeToNextLevel();
     }
 }
Ejemplo n.º 3
0
 /**
  * What happesn when player enters the collider
  *
  * transitions to next level
  */
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         m_LevelChanger.FadeToNextLevel();
     }
 }
Ejemplo n.º 4
0
    private void AddButton(Button prefab, SongData sd)
    {
        // Create Button
        Button button = Instantiate(prefab);

        button.name = sd.songName;

        // Create Label
        Text text = button.GetComponentInChildren <Text>();

        if (text)
        {
            text.text = sd.songName;
        }

        // Add scene transition listener
        button.onClick.AddListener(() =>
        {
            levelChanger.SetSong(sd);
            levelChanger.FadeToNextLevel();
        });

        // Put Under Menu in hierarchy
        RectTransform transform = button.GetComponent <RectTransform>();

        transform.SetParent(GameObject.Find("Menu").transform, false);
        transform.anchoredPosition = position;
        position = position + (Vector2.down * spacing);
    }
Ejemplo n.º 5
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         ScriptCalled.FadeToNextLevel();
     }
 }
Ejemplo n.º 6
0
 public void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Player")
     { //Add Door collision here!
       // Debug.Log("doorhit");
         sn.FadeToNextLevel();
     }
 }
    public void PlayGame()
    {
        levelChanger.FadeToNextLevel();
//        souce.Play();
        startArm.SetActive(true);
        optionArm.SetActive(false);
        QuitArm.SetActive(false);
    }
Ejemplo n.º 8
0
    IEnumerator endNight()
    {
        yield return(new WaitForSeconds(4f));

        levelChanger.FadeToNextLevel();
        yield return(new WaitForSeconds(.75f));

        player.SetActive(true);
    }
Ejemplo n.º 9
0
    IEnumerator changeScenes()
    {
        yield return(new WaitForSeconds(2f));

        levelChanger.FadeToNextLevel();
        yield return(new WaitForSeconds(.7f));

        player.GetComponent <PlayerController>().enabled = true;
    }
Ejemplo n.º 10
0
    IEnumerator DriveToWork()
    {
        stats.gameObject.SetActive(false);
        carAnim.SetBool("ToSchool", true);
        yield return(new WaitForSeconds(2f));

        levelChanger.FadeToNextLevel();
        yield return(new WaitForSeconds(.75f));

        stats.gameObject.SetActive(true);
    }
Ejemplo n.º 11
0
    IEnumerator driveToSchool()
    {
        player.SetActive(false);
        carAnim.SetBool("ToSchool", true);
        yield return(new WaitForSeconds(2f));

        levelChanger.FadeToNextLevel();
        yield return(new WaitForSeconds(.75f));

        player.SetActive(true);
    }
 void Update()
 {
     if (healthBar.GetComponent <Scrollbar>().size == 0f)
     {
         ScriptCalled.FadeToLevel(1);
     }
     else if (healthBarEnnemie.GetComponent <Scrollbar>().size == 0f)
     {
         ScriptCalled.FadeToNextLevel();
     }
 }
Ejemplo n.º 13
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        if (timer > 25 && !called)
        {
            //ring bell events
            levelChanger.FadeToNextLevel();
            called = true;
        }
    }
Ejemplo n.º 14
0
 public override void TriggerEvent()
 {
     if (CanTriggerEvent())
     {
         levelChanger.FadeToNextLevel();
         base.TriggerEvent();
     }
     else
     {
         Debug.LogWarning($"Already triggered event {EventName}");
     }
 }
Ejemplo n.º 15
0
 public void ChangeScene()
 {
     if (timeNewScene >= 0)
     {
         timeNewScene -= Time.deltaTime;
     }
     else
     {
         //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
         changer.FadeToNextLevel();
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (displayTimeRemains > 0)
     {
         displayTimeRemains -= Time.deltaTime;
         if (displayTimeRemains <= 0)
         {
             levelCurtain.FadeToNextLevel();
             enabled = false;
         }
     }
 }
Ejemplo n.º 17
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonUp(0))
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit Hit;
            if (Physics.Raycast(ray, out Hit))
            {
                modelName = Hit.transform.name;
                switch (modelName)
                {
                case "0":
                    levelchanger.FadeToNextLevel();
                    DontDestroyOnLoad(sphere1.gameObject);
                    sphere1.transform.localPosition = new Vector3(0f, 0f, 0f);
                    sphere1.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);

                    break;

                case "1":
                    levelchanger.FadeToNextLevel();
                    DontDestroyOnLoad(sphere2.gameObject);
                    sphere2.transform.localPosition = new Vector3(0f, 0f, 0f);
                    sphere2.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
                    break;

                case "2":
                    levelchanger.FadeToNextLevel();
                    DontDestroyOnLoad(sphere3.gameObject);
                    sphere3.transform.localPosition = new Vector3(0f, 0f, 0f);
                    sphere3.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
                    break;

                default:
                    break;
                }
            }
        }
        OrbitAround();
    }
Ejemplo n.º 18
0
    IEnumerator DriveAway()
    {
        player.SetActive(false);
        mom.SetActive(false);
        dad.SetActive(false);
        carAnim.SetBool("ToBeach", true);
        yield return(new WaitForSeconds(2f));

        levelChanger.FadeToNextLevel();
        yield return(new WaitForSeconds(.75f));

        player.SetActive(true);
    }
Ejemplo n.º 19
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     GameObject.Find("GameManager").GetComponent <GameManager>().actualShapeOnExit = GameObject.Find("Player").GetComponent <PlayerMovement>().actualShape;
     if (gameObject.name == "LevelChangeScene8a" || gameObject.name == "LevelChangeScene7a")
     {
         GameObject.Find("GameManager").GetComponent <GameManager>().is8A = true;
     }
     else if (gameObject.name == "LevelChangeScene8b" || gameObject.name == "LevelChangeScene7b")
     {
         GameObject.Find("GameManager").GetComponent <GameManager>().is8A = false;
     }
     lChanger.FadeToNextLevel(levelToLoad);
 }
Ejemplo n.º 20
0
 // Update is called once per frame
 void Update()
 {
     timer += Time.deltaTime;
     if (timer >= TimeToChangeScene)
     {
         LC.FadeToNextLevel();
     }
     transform.Translate(Vector3.right * Time.deltaTime * velocityRotation);
     target.Translate(Vector3.up * Time.deltaTime * velocityUp);
     transform.Translate(Vector3.up * Time.deltaTime * velocityUp);
     transform.Translate(Vector3.back * Time.deltaTime * velocityBack);
     transform.LookAt(target);
 }
Ejemplo n.º 21
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision == player)
     {
         if (SceneManager.GetActiveScene().name != "Level 2")
         {
             levelChanger.FadeToNextLevel();
         }
         else
         {
             levelChanger.FadeToLevel(0);
         }
     }
 }
Ejemplo n.º 22
0
    void MoveObject()
    {
        Vector3 aPos = gameObject.transform.position;
        Vector3 bPos = new Vector3(0, 0, 0);

        gameObject.transform.position = Vector3.Lerp(aPos, bPos, Time.deltaTime);
        waitForLerp -= Time.deltaTime;

        if (waitForLerp <= 0)
        {
            DontDestroyOnLoad(gameObject);
            levelchanger.FadeToNextLevel();
            gameObject.GetComponent <Orbit>().enabled = false;
        }
    }
Ejemplo n.º 23
0
    void UpdateTime()
    {
        if (time >= 0)
        {
            time          -= Time.deltaTime;
            countdown.text = "Time: " + time.ToString("f0");
        }

        else
        {
            status = arrived;
        }

        if (status.Equals(arrived))
        {
            Debug.Log("Entrou Arrived");

            //if (onLucioIsComing != null)
            {
                //onLucioIsComing();
                shotCount -= Time.deltaTime;

                if (shotCount <= 0 && spawner != stop)
                {
                    Vector3 position = new Vector3(-15f, Random.Range(-4.4f, 4.3f), -1f);

                    Instantiate(shotVariantPrefab, position, Quaternion.identity);

                    shotCount = 1f;
                }
            }

            if (lucioScore >= lucioLimit)
            {
                spawner = stop;

                if (spawnEnemies.numberOfEnemies == 0)
                {
                    changeSceneTimer -= Time.deltaTime;

                    if (changeSceneTimer <= 0)
                    {
                        changer.FadeToNextLevel();
                    }
                }
            }
        }
    }
Ejemplo n.º 24
0
 public override void TriggerEvent()
 {
     if (CanTriggerEvent())
     {
         workCount--;
         Debug.Log("Work done! Remaining: " + workCount);
         CanPress = false;
         GetComponentInChildren <Animator>().SetTrigger("Pressed");
         if (workCount <= 0)
         {
             base.TriggerEvent();
             stats.IncreaseStat(LifeStat.WEALTH);
             stats.GetComponent <SpriteRenderer>().enabled = true;
             levelChanger.FadeToNextLevel();
         }
     }
 }
Ejemplo n.º 25
0
    // Populate content panel with buttons assigned to scenes.
    private void PopulateButtons()
    {
        Debug.Log("scene count " + sceneCount);
        for (int i = 1; i < sceneCount; i++)
        {
            // instantiate a button per scene available in build (except menu scene).
            GameObject obj = Instantiate(levelButtonPrefab);
            // place button under content panel.
            obj.transform.SetParent(contentPanel.transform, false);
            Button button = obj.GetComponent <Button>();

            int val = i;
            // select associated scene when button gets clicked.
            button.onClick.AddListener(delegate { selector.FadeToNextLevel(); });
            // change button text to reflect level number.
            button.GetComponentInChildren <Text>().text = i.ToString();
        }
    }
Ejemplo n.º 26
0
    public void DisplayNextSentence()
    {
        if (sentences.Count == 0)
        {
            EndDialog();

            //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
            changer.FadeToNextLevel();
            //Debug.Log("Vá para a próxima cena");

            return;
        }

        Image sentence = sentences.Dequeue();

        imageDialog.sprite = m_Sprite[i];
        i++;

        //Debug.Log("DisplayNextSentence" + i);
    }
Ejemplo n.º 27
0
    public void TriggerLevelLoad()

    {
        levelChangerHandle.FadeToNextLevel();
    }
Ejemplo n.º 28
0
 public void LevelComplete()
 {
     levelChanger.FadeToNextLevel();
 }
Ejemplo n.º 29
0
 public void restart()
 {
     levelchanger.FadeToNextLevel();
 }