Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. void Update(){
  2. if (Input.GetMouseButtonDown (0) && (!firstCircleSelected)) {
  3. hit = Physics2D.Raycast (new Vector2(Camera.main.ScreenToWorldPoint (Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y),Vector2.zero, Mathf.Infinity, circleLayerMask);
  4. if (hit.collider != null){
  5. Debug.Log ("First value found");
  6. thisValue = hit.collider.gameObject.GetComponent<NumberValue>().value;
  7. firstCircleSelected = true;
  8. findValue();
  9. }
  10. }
  11. }
  12.  
  13. void findValue(){
  14. if (Input.GetMouseButtonDown (0) && (firstCircleSelected)) {
  15. hit2 = Physics2D.Raycast (new Vector2(Camera.main.ScreenToWorldPoint (Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y),Vector2.zero, Mathf.Infinity, circleLayerMask);
  16. if (hit2.collider != null){
  17. Debug.Log ("Second value found");
  18. thatValue = hit2.collider.gameObject.GetComponent<NumberValue>().value;
  19. stateValues();
  20. }
  21. }
  22. }
  23.  
  24. void stateValues(){
  25. Debug.Log ("The first value is "+ thisValue);
  26. Debug.Log ("The second value is "+ thatValue);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement