-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
497 onboarding timdinh #653
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. There is a misconception regarding what is added to GraphElementIDMap. There are also a few minor coding issues.
using SEE.Game.SceneManipulation; | ||
|
||
namespace SEE.Controls.Actions { | ||
public class MarkAction : AbstractPlayerAction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is missing.
|
||
/// <summary> | ||
/// If the user clicks with the mouse hitting a game object representing a graph node, | ||
/// will be marked. A sphere will appear above the marked node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing it
in front of will be marked
.
Vector3 position = parent.transform.position; | ||
Vector3 scale = parent.transform.lossyScale; | ||
// create or delete the sphere | ||
addedSphere = GameNodeMarker.CreateOrDeleteSphere(parent, scale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why passing scale
as a parameter? Position and scale can be retrieved by GameNodeMarker.CreateOrDeleteSphere
.
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this blank line?
public override void Redo() | ||
{ | ||
base.Redo(); | ||
addedSphere = GameNodeAdder.AddChild(memento.Parent, worldSpacePosition: memento.Position, worldSpaceScale: memento.Scale, nodeID: memento.NodeID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. You must use GameNodeMarker.CreateOrDeleteSphere
.
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace SEE.Game.Scenemanipulation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenemanipulation
must be SceneManipulation
. Note that C# is case-sensitive.
/// </summary> | ||
/// <param name="parent">selected node</param> | ||
/// <param name="scale">scale of the node</param> | ||
/// <returns></returns> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return is undocumented.
{ | ||
GameObject sphere = null; | ||
//Search for sphere | ||
foreach(Transform child in parent.transform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could replace the loop by parent.transform.Find("Sphere")
.
{ | ||
GameObject sphere = null; | ||
//Search for sphere | ||
foreach(Transform child in parent.transform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank after foreach
.
} | ||
} | ||
//Delete sphere if one existed | ||
if(sphere != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank after if
.
PR was only for the onboarding task. The onboarding task will not be merged. |
Marking and unmarking nodes has been implemented