Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach (Touch t in Input.touches) {
- if (t.phase == TouchPhase.Began) {
- Ray ray = Camera.main.ScreenPointToRay (t.position);
- //Input.mousePosition
- RaycastHit hit;
- if (Physics.Raycast (ray, out hit)) {
- if (hit.collider.tag == "ice") {
- //if (Input.GetMouseButtonDown (0)) {
- hit.collider.renderer.material.mainTexture = brick;
- // print("oi");
- //atrito.friction=10f;
- hit.collider.tag = "brick";
- hit.collider.collider.sharedMaterial = brickmaterial;
- }
- } else {
- if (hit.collider.tag == "brick") {
- // if (Input.GetMouseButtonDown (0)) {
- hit.collider.renderer.material.mainTexture = ice;
- // print("oi");
- //atrito.friction=0;
- hit.collider.tag = "ice";
- hit.collider.collider.sharedMaterial = icematerial;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement