using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScreenspaceDragDrop : MonoBehaviour
{
public Camera mCamera;
public Canvas canvas;
// Update is called once per frame
void Update()
{
var screenMousePositionPoint = Input.mousePosition;
screenMousePositionPoint.z = canvas.planeDistance;
transform.position = mCamera.ScreenToWorldPoint(screenMousePositionPoint);
}
}
Created
December 4, 2019 20:26
-
-
Save smkplus/eeab649be8d64d223d91fc520a72d168 to your computer and use it in GitHub Desktop.
ScreenSpaceDragAndDrop
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment