Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. private var posX : float[];
  2. private var posY : float[];
  3. private var pos : Vector3[];
  4. private var i = 0;
  5. private var runs = false;
  6.  
  7. function OnMouseDown () {
  8. startPoint = Input.mousePosition;
  9. runs = true;
  10. }
  11.  
  12. function OnMouseDrag(){
  13. while(runs){
  14. posX[i] = Input.GetAxis("Horizontal");
  15. posY[i] = Input.GetAxis("Vertical");
  16. pos[i] = Input.mousePosition;
  17.  
  18. Debug.Log(pos[i].x);
  19.  
  20. if(posY[i-1] > posY[i] && posX[i-1] != posX[i]){
  21. corner1 = pos;
  22. Debug.Log(corner1 + " eins");
  23. }
  24.  
  25. if(posX[i-1] > posX[i] && posY[i-1] == posY[i]){
  26. corner2 = pos;
  27. Debug.Log(corner2 + " zwei");
  28. }
  29.  
  30. i++;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement