问题
I want my Item / GameObject, that to have its limit of draging. GameObject that have a place to stop, and wont able to use again. Droping Target/ Specified Place to Drop.
First Place of Bed
The bed that have moved. In here, but the bed overlap the chair the should have bump.
- This is the bed that i want to end. The bed that can only move from its first place upto the side of the chair.
Im still wondering if it is in some kind of "Vector" code. Im newbie so im still exploring, and also, since its bed, i also want the user to drag the bed a little bit harder like a real person is pulling the big bed, if you know what i mean. If possible.
Code for dragging it. But limitless.
public void OnDrag(PointerEventData eventData)
{
Debug.Log("OnDrag");
Vector3 tempPos = this.transform.position;
tempPos.x = eventData.position.x;
this.transform.position = tempPos;
}
来源:https://stackoverflow.com/questions/39083167/c-sharp-drag-and-then-drop-in-specified-area