public void OnMouseDown() { BlackScreen.SetActive(true); iTween.MoveTo(Arcade30, iTween.Hash("position", new Vector3(-0.11f, 1.9f, -1), "time", 1f, "ignoretimescale", true)); iTween.MoveTo(Arcade60, iTween.Hash("position", new Vector3(-0.11f, -1f, -1), "time", 1)); Ads.Down(); }
void OnMouseDown() { if (UnityAdsHelper.isReady()) { Ads.Down(); } else { Bichapp.SetActive(false); } }
/*************************************************************************************************/ void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "shade1" && player.GetComponent <Renderer>().sortingLayerName == "4") { tips[Random.Range(0, 6)].SetActive(true); coin += Mathf.Round((score_rec.timer) * 0.2f); PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); set_play.startmoving = false; sfx_controller.sfxcollision = 1; score_dynamic.SetActive(false); camflash.SetActive(true); iTween.FadeTo(camflash, iTween.Hash("alpha", 0.0f, "time", 0.10f, "easeType", "easeInSine")); gameover.SetActive(true); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 0.25f, "easeType", "easeInSine")); set_play.musictoplay = 2; iTween.FadeTo(camflash, iTween.Hash("alpha", 255.0f, "time", 2, "easeType", "easeInSine", "transition", "linear")); iTween.MoveTo(camflash, iTween.Hash("position", new Vector3(50.0f, 15f, 810f), "time", 0.2f, "ignoretimescale", true, "transition", "linear")); Time.timeScale = 0; plus.SetActive(false); pause.SetActive(false); minus.SetActive(false); Destroy(collision.gameObject); shade1.GetComponent <Collider2D>().isTrigger = true; shade2.GetComponent <Collider2D>().isTrigger = true; shade3.GetComponent <Collider2D>().isTrigger = true; shade4.GetComponent <Collider2D>().isTrigger = true; N.enabled = false; S.enabled = false; iTween.MoveTo(scoreboard, iTween.Hash("position", new Vector3(-220, 67, 0), "time", 1.0f, "transition", "linear", "ignoretimescale", true)); iTween.MoveTo(saveme, iTween.Hash("position", new Vector3(100f, 0f, -135f), "time", 1.5f, "ignoretimescale", true, "transition", "easeInExpo")); iTween.MoveTo(restart_go, iTween.Hash("position", new Vector3(100.0f, -35.0f, -150), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(best, iTween.Hash("position", new Vector3(-70.0f, -35.0f, -30), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(gameover_msg, iTween.Hash("position", new Vector3(20f, 45.0f, -177f), "time", 1, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(scoreslide, iTween.Hash("position", new Vector3(-70.0f, 0.0f, -30f), "time", 1.5f, "ignoretimescale", true, "transition", "linear", "oncomplete", "lauda")); score_at_gameover.SetActive(true); iTween.FadeFrom(score_at_gameover, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); highscore.SetActive(true); iTween.FadeFrom(highscore, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); playerlauda.SetActive(false); savemecost.SetActive(true); iTween.FadeFrom(savemecost, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); } if (collision.gameObject.tag == "shade2" && player.GetComponent <Renderer>().sortingLayerName == "3") { tips[Random.Range(0, 6)].SetActive(true); coin += Mathf.Round((score_rec.timer) * 0.2f); PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); set_play.startmoving = false; sfx_controller.sfxcollision = 1; score_dynamic.SetActive(false); iTween.MoveTo(scoreboard, iTween.Hash("position", new Vector3(-220, 67, 0), "time", 1.0f, "transition", "linear", "ignoretimescale", true)); camflash.SetActive(true); iTween.FadeTo(camflash, iTween.Hash("alpha", 0.0f, "time", 0.10f, "easeType", "easeInSine")); gameover.SetActive(true); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 0.25f, "easeType", "easeInSine")); set_play.musictoplay = 2; iTween.MoveTo(camflash, iTween.Hash("position", new Vector3(50.0f, 15f, 810f), "time", 0.2f, "ignoretimescale", true, "transition", "linear")); Time.timeScale = 0; plus.SetActive(false); pause.SetActive(false); minus.SetActive(false); Destroy(collision.gameObject); shade1.GetComponent <Collider2D>().isTrigger = true; shade2.GetComponent <Collider2D>().isTrigger = true; shade3.GetComponent <Collider2D>().isTrigger = true; shade4.GetComponent <Collider2D>().isTrigger = true; playerlauda.SetActive(false); N.enabled = false; S.enabled = false; iTween.MoveTo(saveme, iTween.Hash("position", new Vector3(100f, 0f, -135f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(restart_go, iTween.Hash("position", new Vector3(100.0f, -35.0f, -150), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(best, iTween.Hash("position", new Vector3(-70.0f, -35.0f, 0f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(gameover_msg, iTween.Hash("position", new Vector3(20f, 45.0f, -177f), "time", 1, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(scoreslide, iTween.Hash("position", new Vector3(-70.0f, 0.0f, 0f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.FadeTo(highscore, iTween.Hash("alpha", 0.0f, "time", 2, "easeType", "easeInSine", "transition", "linear")); score_at_gameover.SetActive(true); iTween.FadeFrom(score_at_gameover, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); highscore.SetActive(true); iTween.FadeFrom(highscore, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); savemecost.SetActive(true); iTween.FadeFrom(savemecost, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); } if (collision.gameObject.tag == "shade3" && player.GetComponent <Renderer>().sortingLayerName == "2") { tips[Random.Range(0, 6)].SetActive(true); coin += Mathf.Round((score_rec.timer) * 0.2f); PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); set_play.startmoving = false; sfx_controller.sfxcollision = 1; score_dynamic.SetActive(false); iTween.MoveTo(scoreboard, iTween.Hash("position", new Vector3(-220, 67, 0), "time", 1.0f, "transition", "linear", "ignoretimescale", true)); camflash.SetActive(true); iTween.FadeTo(camflash, iTween.Hash("alpha", 0.0f, "time", 0.10f, "easeType", "easeInSine")); gameover.SetActive(true); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 0.25f, "easeType", "easeInSine")); set_play.musictoplay = 2; iTween.MoveTo(camflash, iTween.Hash("position", new Vector3(50.0f, 15f, 810f), "time", 0.2f, "ignoretimescale", true, "transition", "linear")); Time.timeScale = 0; plus.SetActive(false); minus.SetActive(false); pause.SetActive(false); Destroy(collision.gameObject); shade1.GetComponent <Collider2D>().isTrigger = true; shade2.GetComponent <Collider2D>().isTrigger = true; shade3.GetComponent <Collider2D>().isTrigger = true; shade4.GetComponent <Collider2D>().isTrigger = true; playerlauda.SetActive(false); N.enabled = false; S.enabled = false; iTween.MoveTo(saveme, iTween.Hash("position", new Vector3(100f, 0f, -135f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(restart_go, iTween.Hash("position", new Vector3(100.0f, -35.0f, -150), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(best, iTween.Hash("position", new Vector3(-70.0f, -35.0f, 0f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(gameover_msg, iTween.Hash("position", new Vector3(20f, 45.0f, -177f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(scoreslide, iTween.Hash("position", new Vector3(-70.0f, 0.0f, 0f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); score_at_gameover.SetActive(true); iTween.FadeFrom(score_at_gameover, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); highscore.SetActive(true); iTween.FadeFrom(highscore, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); savemecost.SetActive(true); iTween.FadeFrom(savemecost, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); Ads.Down(); } if (collision.gameObject.tag == "shade4" && player.GetComponent <Renderer>().sortingLayerName == "1") { tips[Random.Range(0, 6)].SetActive(true); coin += Mathf.Round((score_rec.timer) * 0.2f); PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); set_play.startmoving = false; sfx_controller.sfxcollision = 1; score_dynamic.SetActive(false); iTween.MoveTo(scoreboard, iTween.Hash("position", new Vector3(-220, 67, 0), "time", 1.0f, "transition", "linear", "ignoretimescale", true)); camflash.SetActive(true); iTween.FadeTo(camflash, iTween.Hash("alpha", 0.0f, "time", 0.10f, "easeType", "easeInSine")); gameover.SetActive(true); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 0.25f, "easeType", "easeInSine")); set_play.musictoplay = 2; iTween.MoveTo(camflash, iTween.Hash("position", new Vector3(50.0f, 15f, 810f), "time", 0.2f, "ignoretimescale", true, "transition", "linear")); Time.timeScale = 0; plus.SetActive(false); minus.SetActive(false); pause.SetActive(false); Destroy(collision.gameObject); shade1.GetComponent <Collider2D>().isTrigger = true; shade2.GetComponent <Collider2D>().isTrigger = true; shade3.GetComponent <Collider2D>().isTrigger = true; shade4.GetComponent <Collider2D>().isTrigger = true; playerlauda.SetActive(false); N.enabled = false; S.enabled = false; iTween.MoveTo(saveme, iTween.Hash("position", new Vector3(100f, 0f, -135f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(restart_go, iTween.Hash("position", new Vector3(100.0f, -35.0f, -150), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(best, iTween.Hash("position", new Vector3(-70.0f, -35.0f, 0f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(gameover_msg, iTween.Hash("position", new Vector3(20f, 45.0f, -177f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(scoreslide, iTween.Hash("position", new Vector3(-70.0f, 0.0f, 0f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); score_at_gameover.SetActive(true); iTween.FadeFrom(score_at_gameover, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); highscore.SetActive(true); iTween.FadeFrom(highscore, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); savemecost.SetActive(true); iTween.FadeFrom(savemecost, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); } if (collision.gameObject.tag == "blackup") { tips[Random.Range(0, 6)].SetActive(true); coin += Mathf.Round((score_rec.timer) * 0.2f); PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); set_play.startmoving = false; sfx_controller.sfxcollision = 1; score_dynamic.SetActive(false); iTween.MoveTo(scoreboard, iTween.Hash("position", new Vector3(-220, 67, 0), "time", 1.0f, "transition", "linear", "ignoretimescale", true)); camflash.SetActive(true); iTween.FadeTo(camflash, iTween.Hash("alpha", 0.0f, "time", 0.10f, "easeType", "easeInSine")); gameover.SetActive(true); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 0.25f, "easeType", "easeInSine")); set_play.musictoplay = 2; Destroy(collision.gameObject); iTween.MoveTo(camflash, iTween.Hash("position", new Vector3(50.0f, 15f, 810f), "time", 0.2f, "ignoretimescale", true, "transition", "easeInExpo")); Time.timeScale = 0; plus.SetActive(false); pause.SetActive(false); minus.SetActive(false); playerlauda.SetActive(false); N.enabled = false; S.enabled = false; iTween.MoveTo(saveme, iTween.Hash("position", new Vector3(100f, 0f, -135f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(restart_go, iTween.Hash("position", new Vector3(100.0f, -35.0f, -150), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(best, iTween.Hash("position", new Vector3(-70.0f, -35.0f, 0f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(gameover_msg, iTween.Hash("position", new Vector3(20f, 45.0f, -177f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(scoreslide, iTween.Hash("position", new Vector3(-70.0f, 0.0f, 0f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); score_at_gameover.SetActive(true); iTween.FadeFrom(score_at_gameover, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); highscore.SetActive(true); iTween.FadeFrom(highscore, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); savemecost.SetActive(true); iTween.FadeFrom(savemecost, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); Ads.Down(); } if (collision.gameObject.tag == "blackdown") { tips[Random.Range(0, 6)].SetActive(true); coin += Mathf.Round((score_rec.timer) * 0.2f); PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); set_play.startmoving = false; sfx_controller.sfxcollision = 1; score_dynamic.SetActive(false); iTween.MoveTo(scoreboard, iTween.Hash("position", new Vector3(-220, 67, 0), "time", 1.0f, "transition", "linear", "ignoretimescale", true)); camflash.SetActive(true); iTween.FadeTo(camflash, iTween.Hash("alpha", 0.0f, "time", 0.10f, "easeType", "easeInSine")); gameover.SetActive(true); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 0.25f, "easeType", "easeInSine")); set_play.musictoplay = 2; Destroy(collision.gameObject); iTween.MoveTo(camflash, iTween.Hash("position", new Vector3(50.0f, 15f, 810f), "time", 0.2f, "ignoretimescale", true, "transition", "easeInExpo")); Time.timeScale = 0; plus.SetActive(false); minus.SetActive(false); pause.SetActive(false); playerlauda.SetActive(false); N.enabled = false; S.enabled = false; iTween.MoveTo(saveme, iTween.Hash("position", new Vector3(100f, 0f, -135f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(restart_go, iTween.Hash("position", new Vector3(100.0f, -35.0f, -150), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(best, iTween.Hash("position", new Vector3(-70.0f, -35.0f, 0f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(gameover_msg, iTween.Hash("position", new Vector3(20f, 45.0f, -177f), "time", 2, "ignoretimescale", true, "transition", "linear")); iTween.MoveTo(scoreslide, iTween.Hash("position", new Vector3(-70.0f, 0.0f, 0f), "time", 1.5f, "ignoretimescale", true, "transition", "linear")); iTween.FadeTo(gameover, iTween.Hash("alpha", 0.0f, "time", 1, "easeType", "easeInSine")); score_at_gameover.SetActive(true); iTween.FadeFrom(score_at_gameover, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); highscore.SetActive(true); iTween.FadeFrom(highscore, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); savemecost.SetActive(true); iTween.FadeFrom(savemecost, iTween.Hash("alpha", 0.0, "time", 1, "easeType", "easeInSine", "transition", "linear", "ignoretimescale", true)); } if (collision.gameObject.tag == "collectable") { Destroy(collision.gameObject); Debug.Log(" destroyed"); if (player.GetComponent <Renderer>().material.color == blackup.GetComponent <Renderer>().material.color) { Debug.Log("coin fetched!"); coin = coin + 1; PlayerPrefs.SetFloat("coins", coin); PlayerPrefs.Save(); Debug.Log("trueeee"); } } if (collision.gameObject.tag == "boost") { Destroy(collision.gameObject); StartCoroutine(inctimescale()); player.GetComponent <Collider2D>().isTrigger = true; StartCoroutine(activatecollision()); sfx_controller.sfxboost = 1; } }