feedback addressed
This commit is contained in:
@@ -51,21 +51,21 @@ public class Puck : MonoBehaviour
|
||||
|
||||
GameManager.instance.DisposePuck(this);
|
||||
}
|
||||
|
||||
public Vector3 lineEnd;
|
||||
void Update()
|
||||
{
|
||||
if (isSelected && lineRenderer != null)
|
||||
{
|
||||
Vector3 worldEnd = Camera.main.ScreenToWorldPoint(new Vector3(GameManager.instance.curPosition.x, GameManager.instance.curPosition.y, Camera.main.nearClipPlane));
|
||||
|
||||
Vector3 localEnd = transform.InverseTransformPoint(worldEnd);
|
||||
lineEnd = transform.InverseTransformPoint(worldEnd);
|
||||
float clamp = GameManager.instance.puckDragClamp;
|
||||
localEnd = Vector2.ClampMagnitude(localEnd, clamp);
|
||||
lineEnd = Vector2.ClampMagnitude(lineEnd, clamp);
|
||||
|
||||
// Only two points for the line
|
||||
lineRenderer.positionCount = 2;
|
||||
lineRenderer.SetPosition(0, Vector3.zero);
|
||||
lineRenderer.SetPosition(1, new Vector3(localEnd.x, localEnd.y, 0));
|
||||
lineRenderer.SetPosition(1, new Vector3(lineEnd.x, lineEnd.y, 0));
|
||||
}
|
||||
|
||||
selectedMarker.gameObject.SetActive(GetMarkerVisibility());
|
||||
|
||||
Reference in New Issue
Block a user