Advertisement
tuhin_09

Untitled

Nov 24th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class circleScript : MonoBehaviour {
  5.  
  6.  
  7. // Use this for initialization
  8. void Start () {
  9.  
  10. }
  11.  
  12. // Update is called once per frame
  13. void Update () {
  14. if (Input.touchCount > 0 && Input.GetTouch (0).phase == TouchPhase.Began) {
  15. Vector3 touchWorldPoint = Camera.main.ScreenToWorldPoint (Input.GetTouch (0).position);
  16.  
  17. touchWorldPoint.z = 0f;
  18.  
  19. RaycastHit2D hit = Physics2D.Raycast (touchWorldPoint, -Vector2.up);
  20.  
  21. if (hit) {
  22. Debug.Log("hoynay");
  23.  
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement