Skip to content
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

Closed
wants to merge 1 commit into from
Closed

497 onboarding timdinh #653

wants to merge 1 commit into from

Conversation

TimDinh-hub
Copy link
Collaborator

Marking and unmarking nodes has been implemented

Copy link
Collaborator

@koschke koschke left a 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
Copy link
Collaborator

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.
Copy link
Collaborator

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);
Copy link
Collaborator

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.

}
}
}

Copy link
Collaborator

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);
Copy link
Collaborator

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
Copy link
Collaborator

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>
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank after if.

@koschke
Copy link
Collaborator

koschke commented Oct 28, 2023

PR was only for the onboarding task. The onboarding task will not be merged.

@koschke koschke closed this Oct 28, 2023
@koschke koschke deleted the 479-onboarding-timdinh branch October 28, 2023 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants