minigame hole dokončeno
This commit is contained in:
@@ -34,7 +34,7 @@ public class DraggableObject : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
rb.useGravity = false;
|
||||
rb.useGravity = true;
|
||||
rb.constraints = RigidbodyConstraints.FreezeRotation;
|
||||
targetPosition = transform.position;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class DraggableObject : MonoBehaviour
|
||||
{
|
||||
HandleInput();
|
||||
}
|
||||
void FixedUpdate()
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (isDragging)
|
||||
{
|
||||
@@ -73,9 +73,10 @@ public class DraggableObject : MonoBehaviour
|
||||
else
|
||||
{
|
||||
//Vector3 worldPos = mainCamera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10f));
|
||||
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
TryStartDrag(Input.mousePosition);
|
||||
}
|
||||
else if (Input.GetMouseButton(0) && isDragging)
|
||||
UpdateDrag(Input.mousePosition);
|
||||
else if (Input.GetMouseButtonUp(0) && isDragging)
|
||||
|
||||
Reference in New Issue
Block a user