Skip to content

Commit

Permalink
#479 added FIXME's: could not fix scaling issue with marker spheres
Browse files Browse the repository at this point in the history
Relative positions and scales do not spawn marker spheres at required
positions and with required sizes. Code needs adapting to relative
scaling in Unity.
  • Loading branch information
m4xxed committed Oct 21, 2022
1 parent a0aa92e commit 3c2e41c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Assets/SEE/Controls/Actions/MarkAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override bool Update()

GameObject markerSphere = GameNodeMarker.TryMarking(targetNode);

memento = new Memento(markerSphere);
memento = new Memento(targetNode);

new MarkNetAction(markerSphere).Execute();

Expand Down
10 changes: 4 additions & 6 deletions Assets/SEE/Game/GameNodeMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ public static GameObject TryMarking(GameObject targetNode)
// create a new marker sphere because there is none currently
GameObject newMarkerSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);

Debug.Log("X is:" + newMarkerSphere.transform.localScale.x);
Debug.Log("Y is:" + newMarkerSphere.transform.localScale.y);
Debug.Log("Z is:" + newMarkerSphere.transform.localScale.z);

// the diameter of the is the minimum of the width (x-axis) and depth (y-axis) of the marked node
newMarkerSphere.transform.localScale = Math.Min(targetNode.transform.localScale.x, targetNode.transform.localScale.z) * .5f * Vector3.one;
// FIXME: (?) this is totally not working...
// the position of the marker sphere is above the marked node
newMarkerSphere.transform.position = new Vector3(0, 0, 0);

// FIXME: (?) this isn't working either...
// the position of the marker sphere is above the marked node
newMarkerSphere.transform.position = new Vector3(targetNode.transform.position.x,
targetNode.transform.position.y,
Expand Down

0 comments on commit 3c2e41c

Please sign in to comment.