-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: develop
Are you sure you want to change the base?
M wong #1
Conversation
…ontain the enum value for the bbt ingredient. An event handle scripts is put in the camera to handle event calls
I'll add reminders on the Trello but usually:
|
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. |
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 }; |
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.
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
Assets/Scripts/PlayerActor.cs
Outdated
{ | ||
Debug.Log("triggerEnter"); | ||
|
||
IngredientCollectibleBehaviour behaviour = other.gameObject.GetComponent<IngredientCollectibleBehaviour>() as IngredientCollectibleBehaviour; |
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 did you need to add 'as' at the end?
Assets/Scripts/PlayerActor.cs
Outdated
IngredientCollectibleBehaviour behaviour = other.gameObject.GetComponent<IngredientCollectibleBehaviour>() as IngredientCollectibleBehaviour; | ||
if (behaviour != null) | ||
{ | ||
Data.IngredientCollectibles test = behaviour.callCollect(); |
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.
I think if you use a separate class for enums, you may not need to do this? Give it a try
Assets/Scripts/PlayerActor.cs
Outdated
|
||
if (result) { | ||
DestroyableBehaviour destroyableBehaviour = other.gameObject.GetComponent<DestroyableBehaviour>() as DestroyableBehaviour; | ||
destroyableBehaviour.callDestroy(); |
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 can just keep destroy in the same class since its basically 2 lines.
@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?