示例#1
0
    // Update is called once per frame
    void Update()
    {
        time += Time.deltaTime;



        if (Mathf.Round(time) == 2 && m1.stop == true)
        {
            story1.text = "This is bounce's friend " +
                          "Bumpy cracks!!! , a boulder";
        }

        if (Mathf.Round(time) == 4 && m1.stop == true)
        {
            story1.text = "Press 2 to switch to bumpy " +
                          "cracks and 1 for bounce";
        }



        if (Mathf.Round(time) == 5 && m1.stop == true)
        {
            f1 = GameObject.Find("rock_ball_sprite").GetComponent <fading>();
            f1.fade();
            m1.stop = false;
        }
        if (Mathf.Round(time) == 6)
        {
            m1.GetComponent <Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
            story1.text = "";
        }
    }
示例#2
0
 // Update is called once per frame
 void Update()
 {
     t1 = GameObject.Find("trigger1").GetComponent <trigger>();
     f1 = GameObject.Find("rock_ball_sprite").GetComponent <fading>();
     if (t1.b1)
     {
         gameObject.GetComponent <Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
         // Debug.Log(gameObject.GetComponent<Rigidbody2D>().bodyType);
         f1.fade();
     }
 }
示例#3
0
    // Use this for initialization
    IEnumerator OnTriggerEnter2D(Collider2D Colider)
    {
        fading f = GameObject.FindGameObjectWithTag("Fader").GetComponent <fading>();

        yield return(StartCoroutine(f.fadeToBlack()));

        if (Colider.gameObject.tag == "Player")
        {
            SceneManager.LoadScene(level);
        }
        Debug.Log("its Colliding!");
    }
示例#4
0
    IEnumerator OnTriggerEnter2D(Collider2D Colider)
    {
        fading f = GameObject.FindGameObjectWithTag("Fader").GetComponent <fading>();

        yield return(StartCoroutine(f.fadeToBlack()));

        if (Colider.gameObject.tag == "Player")
        {
            if (SceneManager.GetActiveScene().name == "cuarto")
            {
                SceneManager.LoadScene(level);
            }
            else
            {
                PlayerPrefs.SetInt("nivel", id);
                SceneManager.LoadScene("cuarto");
            }
        }

        Debug.Log("its Colliding!");
    }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     f1 = GameObject.Find("rock_ball_sprite").GetComponent <fading>();
 }