void Start() { pointer = GetComponent <ShowMousePosition>(); moving = false; pared = -1; internalColor = externalColor; }
void OnMouseDown() { /*int x=Selection.GetComponent<SelectionManager>().modi; * if (x != 2) * return;*/ if (!enabled) { return; } this.gameObject.layer = LayerMask.NameToLayer("Ignore Raycast"); pointer1 = Camera.main.GetComponent <ShowMousePosition>(); Vector3 Mouse = pointer1.getWorldPoint(); Mouse = pointer1.snapPosition(Mouse); mOffset = this.transform.position - Mouse; /* * mOffset.x = this.transform.position.x- pointer.mousePointer.transform.position.x; * mOffset.y = this.transform.position.y - pointer.mousePointer.transform.position.y; * mOffset.z = this.transform.position.z - pointer.mousePointer.transform.position.z;*/ }
// Start is called before the first frame update void Start() { pointer = GetComponent <ShowMousePosition>(); }