Wednesday, April 13, 2016

Coding marathon

I have been coding for a week, like 3-4 hours every day, and also writing the game script, RPG system, and a few pages in my last novel. I have been trying code in the test project (the one I abandoned) and then doing thi things "right" in the prototype. Im pleased to say that I found how to properly implement drag and drop. The sample was there in my PC, waiting for me to look at it, and it was totally different to the approach I was taking.

I was trying to avoid using IDragHandler and the other interfaces, because I thought it was harder, yet, I was wrong. Actually, it is easier. Of course, I needed some basic code I took from the sample, but from there I have learned to implement not only drag and drop, but also mouse button events, mouse enter/exit, etc. All this while keeping control of what GameObject generated the event, via BaseEventData and derived classes.

Im working to implement drag and drop in the inventory for The Key of the World, which will take a few days, because it demands to fix the item system and make sure that a few details work as expected. The code will be available in github as soon as it is ready.

No comments:

Post a Comment