public void OnDrag(PointerEventData eventData) { if (fix == false) { // seat centrale picture this.transform.position = eventData.position; // place first input pos.x = eventData.position.x - (width_c * (float)0.5) + margin_x; if (node_in2 != null) { /* suppression partie graphique*/ obj_enter1.DeletePath(); obj_enter1.Unlinkin(); obj_enter2.DeletePath(); obj_enter2.Unlinkin(); obj_src.NewPath(); obj_src.Unlinkout(); /*mise à jour de la position*/ pos.y = eventData.position.y + margin_y; node_in1.transform.position = pos; pos.y = pos.y - 2 * margin_y; node_in2.transform.position = pos; pos.x = pos.x + (width_c) - 2 * margin_x; pos.y = pos.y + margin_y; node_out.transform.position = pos; } else { /* suppression partie graphique*/ obj_enter1.DeletePath(); obj_enter1.Unlinkin(); obj_src.NewPath(); obj_src.Unlinkout(); /*mise à jour de la position*/ pos.y = eventData.position.y; node_in1.transform.position = pos; pos.x = pos.x + width_c - 2 * margin_x; node_out.transform.position = pos; } } }
public void OnDrag(PointerEventData eventData) { if (in0.fix_drag == false) { if (in0.Getdragged() == false || (in0.Getdragged() == true && Time.time - time > 0.5)) { this.transform.position = eventData.position; pos.x = eventData.position.x + 30; pos.y = eventData.position.y; node.transform.position = pos; obj_in.NewPath(); obj_in.Unlinkout(); } } }