Advertisement
S0m3guy

Untitled

Jun 4th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. void OnMouseDown() {
  2.             pressed = true;
  3.             if (!isClone) {
  4.                 if (transform.parent.name.Contains("AND")) {
  5.                     clone = Instantiate(Resources.Load("FB/FunctionBlock_AND")) as GameObject;
  6.                       ...
  7.                 }
  8.             }
  9.             screenPoint = Camera.main.WorldToScreenPoint (gameObject.transform.position);
  10.    
  11.             offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint (new Vector3 (Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement