Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. foreach (Touch t in Input.touches) {
  2. if (t.phase == TouchPhase.Began) {
  3. Ray ray = Camera.main.ScreenPointToRay (t.position);
  4.  
  5.  
  6. //Input.mousePosition
  7. RaycastHit hit;
  8. if (Physics.Raycast (ray, out hit)) {
  9. if (hit.collider.tag == "ice") {
  10. //if (Input.GetMouseButtonDown (0)) {
  11. hit.collider.renderer.material.mainTexture = brick;
  12. // print("oi");
  13. //atrito.friction=10f;
  14. hit.collider.tag = "brick";
  15. hit.collider.collider.sharedMaterial = brickmaterial;
  16. }
  17. } else {
  18. if (hit.collider.tag == "brick") {
  19. // if (Input.GetMouseButtonDown (0)) {
  20. hit.collider.renderer.material.mainTexture = ice;
  21. // print("oi");
  22. //atrito.friction=0;
  23. hit.collider.tag = "ice";
  24. hit.collider.collider.sharedMaterial = icematerial;
  25. }
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement