private void checkTap() { lp.z = 0; Vector3 screenPoint = Camera.main.ScreenToWorldPoint(lp); hit = Physics2D.Raycast(screenPoint, Vector2.zero); Debug.Log("checkTap"); if (hit.collider != null) { string hitObject = hit.transform.gameObject.name; switch (hitObject) { case "FishBoss": AudioManager.PlayAudio(AudioType.UI_Dialogue); FinalCameraController.BossTalk(); break; case "PlayerBodySubway": AudioManager.PlayAudio(AudioType.UI_Dialogue); FinalCameraController.ChangeToCloth(); break; case "PlayerHeadSubway": AudioManager.PlayAudio(AudioType.UI_Dialogue); FinalCameraController.ChangeToCloth(); break; case "SettingButton": AudioManager.PlayAudio(AudioType.UI_Dialogue); FinalCameraController.clickSetting(); break; case "subwayMap": AudioManager.PlayAudio(AudioType.UI_Dialogue); FinalCameraController.ChangeToMap(); break; case "Lost&Found_basket": AudioManager.PlayAudio(AudioType.UI_Dialogue); LostAndFound.clickLostFound(); break; } Regex mRegular = new Regex(@"Poster\d+", RegexOptions.None); if (mRegular.IsMatch(hit.transform.gameObject.name)) { AdsController.ClickBackground(hit.transform.GetComponent <SpriteRenderer>().sprite.name); } //DebugOutput.GetComponent<Text>().text = hit.transform.gameObject.name; Debug.Log(hit.transform.gameObject.name); } }