Example #1
0
    // Update is called once per frame
    void Update()
    {
        UIMat ui = UIop.GetComponent <UIMat>();

        if (ui.play == true)
        {
            Destroy(this.gameObject);
        }
        if (PlayerPrefs.HasKey("SquareSelect"))
        {
            if (PlayerPrefs.GetInt("SquareSelect") == 1)
            {
                sqpl1.SetActive(true);
                sqr1.SetActive(true);
            }
            else if (PlayerPrefs.GetInt("SquareSelect") == 2)
            {
                sqpl2.SetActive(true);
                sqr2.SetActive(true);
            }
            else if (PlayerPrefs.GetInt("SquareSelect") == 3)
            {
                sqr3.SetActive(true);
                sqpl3.SetActive(true);
            }
        }
        else
        {
            sqpl1.SetActive(true);
            sqr1.SetActive(true);
        }
    }
Example #2
0
    void Continued()
    {
        restartdead.SetActive(true);
        mainmenu.SetActive(true);
        deadtext.SetActive(true);
        UIMat ui = uiop.GetComponent <UIMat> ();

        ui.highscstart = true;
        vibrate        = false;
        vibratecount   = 0;
    }
Example #3
0
    void OnCollisionEnter2D(Collision2D other)
    {
        UIMat score = Scoretext.GetComponent <UIMat> ();

        if (other.gameObject.tag == "Player")
        {
            score.score1 += 5;
            score.PlusFive();
            Destroy(this.gameObject);
        }
    }
Example #4
0
    void OnCollisionEnter2D(Collision2D other)
    {
        if (other.gameObject.tag == "Enemy")
        {
            Time.timeScale = 0;
            //canmove = false;
            UIMat        uiscript1 = UIop.GetComponent <UIMat> ();
            CameraColour camzoom   = cam.GetComponent <CameraColour> ();
            //camzoom.DeathLook (other.gameObject.transform);
            //StartCoroutine (Vibrate ());
            Restart.SetActive(true);
            Menu.SetActive(true);
            Deadtext.SetActive(true);
            transform.position    = new Vector3(0, 0, 0);
            uiscript1.highscstart = true;
            audiomain.Stop();
            //cam.transform.position = this.transform.position;
            //cam.GetComponent<Camera> ().orthographicSize = 2;
            GetComponentInChildren <TrailRenderer>().Clear();

            this.gameObject.SetActive(false);
        }
    }