Пример #1
0
    IEnumerator EndAfterSeconds()
    {
        GetComponent <MovePlayer>().enabled = false;
        yield return(new WaitForSeconds(.5f));

        ScreenShake2D.Shake(0f, 0f);
        Application.LoadLevel(Application.loadedLevel);
    }
Пример #2
0
 public void Lose()
 {
     scoremanager.FreezeTimer();
     scoremanager.MakeScoreRed();
     ScreenShake2D.Shake(.25f, .5f);
     GetComponent <AudioSource>().PlayOneShot(hitsound);
     GetComponent <AudioSource>().Play();
     StartCoroutine("EndAfterSeconds");
 }
Пример #3
0
 public void DestroyObstacle(Collider c)
 {
     ScreenShake2D.Shake(.25f, 1f);
     Destroy(c.gameObject);
     Instantiate(useparticle, c.transform.position, useparticle.transform.rotation);
     GetComponent <AudioSource>().PlayOneShot(usesound);
     transform.parent.GetComponent <MovePlayer>().scoremanager.IncrementScore();
     powerups--;
     powerupcounter.text = powerups.ToString();
 }