Advertisement
KorolevDmitry123

Untitled

Jul 20th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Frame : MonoBehaviour {
  5. public GameObject frame;
  6. public GameObject top;
  7. public GameObject topLeft;
  8. public GameObject topRight;
  9. public GameObject left;
  10. public GameObject right;
  11. public GameObject bottom;
  12. public GameObject bottomRight;
  13. public GameObject bottomLeft;
  14. private Vector3 vector1;
  15. private Vector3 vector2;
  16. private Vector3 vector3;
  17. public LeftRaycast lr;
  18. public BottomRaycast br;
  19. void Start()
  20. {
  21.  
  22. }
  23. void Update()
  24. {
  25. vector1 = frame.transform.position - bottomLeft.transform.position;
  26. topRight.transform.position = vector1 + frame.transform.position;
  27. if (lr.isHit == true)
  28. {
  29. vector2 = frame.transform.position - bottomLeft.transform.position;
  30. topLeft.transform.position = -vector2 + frame.transform.position;
  31. left.transform.position = -vector2 + frame.transform.position;
  32. right.transform.position = vector2 + frame.transform.position;
  33. bottomRight.transform.position = vector2 + frame.transform.position;
  34. }
  35. if (br.isHit == true)
  36. {
  37.  
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement