Guest User

Untitled

a guest
Jun 22nd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. if (Input.GetKeyDown(KeyCode.Mouse1))
  2.         {
  3.             for (int n = 0; n < 8; n++)
  4.             {
  5.                 // X axis raycast
  6.                 RaycastHit[] hits;
  7.                 hits = Physics.RaycastAll(floorsX[n].transform.position, Vector3.up, 9);
  8.                 for (int m = 0; m < 8; m++)
  9.                 {
  10.                     floorListX[n, m] = hits[m].collider.gameObject;
  11.                     print(hits[m].collider.gameObject.GetComponent<controllCube>().colourFacing);
  12.                 }
  13.  
  14.                 // Y axis raycast
  15.                 RaycastHit[] hits2;
  16.                 hits2 = Physics.RaycastAll(floorsY[n].transform.position, Vector3.right, 9);
  17.                 for (int m = 0; m < 8; m++)
  18.                 {
  19.                     floorListY[n, m] = hits2[m].collider.gameObject;
  20.                 }
  21.             }
  22. }
Add Comment
Please, Sign In to add comment