Skip to content

Commit

Permalink
Lane arrows look better and work
Browse files Browse the repository at this point in the history
  • Loading branch information
kvakvs committed Jun 26, 2019
1 parent 55ba94e commit 7b081e1
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 92 deletions.
10 changes: 6 additions & 4 deletions TLM/TLM/UI/CanvasGUI/WorldSpaceGUI.cs
Expand Up @@ -73,7 +73,7 @@ public class WorldSpaceGUI {
var rectTransform = gameObject.GetComponent<RectTransform>();

// adjust position from a more natural way to Unity3d Y facing down
pos.y = -(pos.y + size.y);
// pos.y = -(pos.y + size.y);

rectTransform.localPosition = pos;
rectTransform.localScale = new Vector3(1f, 1f, 1f);
Expand Down Expand Up @@ -198,14 +198,16 @@ public class WorldSpaceGUI {
/// <returns></returns>
public List<RaycastResult> RaycastMouse() {
// Set up the new Pointer Event
var results = new List<RaycastResult>();
if (raycaster_ == null) {
return results;
}

var pointerEventData = new PointerEventData(eventSystem_);

// Set the Pointer Event Position to that of the mouse position
pointerEventData.position = Input.mousePosition;

// Create a list of Raycast Results
var results = new List<RaycastResult>();

// Raycast using the Graphics Raycaster and mouse click position
raycaster_.Raycast(pointerEventData, results);
return results;
Expand Down

0 comments on commit 7b081e1

Please sign in to comment.