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

M wong #1

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

M wong #1

wants to merge 5 commits into from

Conversation

Wong-Michael
Copy link

@mikeslgoh How would you go about reviewing and testing this? Most of the unity specific stuff is hard to read.

I did not add code to start collecting the collectibles since it would make this PR more difficult to read. I've designed the script behaviors to be as minimal as possible so that they could be flexibly used for any new prefab. The downside to this is that the collector would need to handle all possible behaviors which would make it a god class. Should I consider it in my design?

…ontain the enum value for the bbt ingredient. An event handle scripts is put in the camera to handle event calls
@mikeslgoh
Copy link
Contributor

I'll add reminders on the Trello but usually:

  1. Name your branch after the feature you just created so you can say MWong/Collectibles or at least have the feature in the title
  2. add everyone on the team as reviews on the side of the PR
  3. ideally keep the description short and the further questions/explanation can be mentioned on Discord
  4. Post the PR link to discord :)

@mikeslgoh
Copy link
Contributor

In terms of how to review, the ways for doing this are opening your branch in Unity to test functionality and also reviewing your C# code here directly.

@Wong-Michael
Copy link
Author

Sorry guys, The branch should be for collectibles. If you open up the Collectible Scene, you should see a diamond, the dummy player object, and the square sugar object. When playing the scene, if the player is dragged over the sugar object, it should trigger logs and delete itself


namespace Data
{
public enum IngredientCollectibles { Invalid, Pearls, Sugar, Milk, Tea };
Copy link
Contributor

Choose a reason for hiding this comment

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

Try creating a separate class for the enums so that we don't need to use namespace and we can access the enums beyond this script

{
Debug.Log("triggerEnter");

IngredientCollectibleBehaviour behaviour = other.gameObject.GetComponent<IngredientCollectibleBehaviour>() as IngredientCollectibleBehaviour;
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you need to add 'as' at the end?

IngredientCollectibleBehaviour behaviour = other.gameObject.GetComponent<IngredientCollectibleBehaviour>() as IngredientCollectibleBehaviour;
if (behaviour != null)
{
Data.IngredientCollectibles test = behaviour.callCollect();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if you use a separate class for enums, you may not need to do this? Give it a try


if (result) {
DestroyableBehaviour destroyableBehaviour = other.gameObject.GetComponent<DestroyableBehaviour>() as DestroyableBehaviour;
destroyableBehaviour.callDestroy();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just keep destroy in the same class since its basically 2 lines.

@mikeslgoh
Copy link
Contributor

Collectibles

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