Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update(){
- if (Input.GetMouseButtonDown (0) && (!firstCircleSelected)) {
- hit = Physics2D.Raycast (new Vector2(Camera.main.ScreenToWorldPoint (Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y),Vector2.zero, Mathf.Infinity, circleLayerMask);
- if (hit.collider != null){
- Debug.Log ("First value found");
- thisValue = hit.collider.gameObject.GetComponent<NumberValue>().value;
- firstCircleSelected = true;
- findValue();
- }
- }
- }
- void findValue(){
- if (Input.GetMouseButtonDown (0) && (firstCircleSelected)) {
- hit2 = Physics2D.Raycast (new Vector2(Camera.main.ScreenToWorldPoint (Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y),Vector2.zero, Mathf.Infinity, circleLayerMask);
- if (hit2.collider != null){
- Debug.Log ("Second value found");
- thatValue = hit2.collider.gameObject.GetComponent<NumberValue>().value;
- stateValues();
- }
- }
- }
- void stateValues(){
- Debug.Log ("The first value is "+ thisValue);
- Debug.Log ("The second value is "+ thatValue);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement