Unity3D And How to Master Stitching Using Autofac

In Unity3D, the scripts we write and attach to GameObjects inherit from a base class called MonoBehaviour (and yes, that says Behaviour with a U in it, not the American spelling like Behavior... Just a heads up). MonoBehaviour instances can be attached to GameObjects in code by calling the AddComponent method, which takes a type parameter or type argument, and returns the new instance of the attached MonoBehaviour that it creates. This API usage means that: We cannot attach existing instances of a MonoBehaviour to a GameObject Unity3D takes care of instantiating MonoBehaviours for us (thanks Unity!) ... We can't pass parameters into the constructor of a MonoBehaviour because Unity3D only handles parameterless constructors (boo Unity!) So what's the problem with that? It kind of goes against some design patterns I'm a big fan of, where you pass your object's…

1 Comment

What Makes Good Code? – Patterns and Practices Series

What Makes Good Code? It's been a while since I've had a programming oriented post, and I figured this would be a great topic to write about. It's been a topic I've been thinking about more and more over the last year and I've been experimenting with certain patterns and practices to see if certain things actually make code "better". A lot of the information presented in this series will be completely based on my opinion, but I'll try to back up my opinion with as many concrete examples as I can. If you have a differing opinion, I'd love to hear it in the comments. I'd also like to call out that much of what I'll be discussing is in the context of object oriented programming. To be specific, there may be mostly C# examples used. If this isn't something…

1 Comment

ProjectXyz: Why I Started a Side Project (Part 1)

ProjectXyz Alright, I'll admit it... Even for a placeholder name on a side project it's pretty terrible, right? Well, my apologies. So, if you made it to this post you might be wondering what ProjectXyz is and why I started it up. From a high level, I started working on ProjectXyz so that I could have a hobby programming project to tinker with and I figured I'd blog about my adventures in bringing it all together. I plan on making this a mini-series documenting some of the things I'm learning or experimenting with, so this will serve as the intro to the series. Before we get too far, here's the link to the GitHub site: https://github.com/ncosentino/ProjectXyz Why Have a Side Project? Here's the main thing I want to talk about in part 1 of this series: Why should you have a…

3 Comments

End of content

No more pages to load