I've never seen this being explained so clearly, so concisely and with such good reasoning behind all the points made throughout the video. Good job and keep it up!
One super useful one that I use all the time is a "GetRandom()" method, made for ILists. This way, I can avoid the constant - and tedious- other way of: int roll = Random.Range(0, longListName.Count); var item = longListName[roll]; I also made overloads for this, that gives me a list of random elements, being able to set a stale queue (only returns an element once per X minumum other elements have been added), etc.
Prefer written tutorials? Here's the blog post for the video: onewheelstudio.com/blog/2021/7/14/c-extension-methods Project File: github.com/onewheelstudio/Adventures-in-C-Sharp/tree/main/ExtensionMethods
Events and static functions! But mostly events! :) I have at least a dozen managers in my personal project and not a single use of the Singleton Pattern. It's not always a bad pattern, but I think it is mostly used to communicate between managers. A lot of that communication can be done with events that doesn't cause massive coupling of different classes. All that said, this could be a cool idea for video! Any problems in particular you've run into? Problems you are trying to solve?
@@OneWheelStudio I have used singletons to create managers but it has dependencies as project grow I just want to know if there is proper way of doing it. Thank you for the information.
"vectorFloat" is just a name of a variable of the type Vector3 - just the usual type nothing special. I named it that to try and make a clear separation between the float and integer version of Vector3.
I've never seen this being explained so clearly, so concisely and with such good reasoning behind all the points made throughout the video. Good job and keep it up!
I make games with Unity for a long time, this thing, I missed so far.
So this procrastination session was time well spent.
One super useful one that I use all the time is a "GetRandom()" method, made for ILists. This way, I can avoid the constant - and tedious- other way of:
int roll = Random.Range(0, longListName.Count);
var item = longListName[roll];
I also made overloads for this, that gives me a list of random elements, being able to set a stale queue (only returns an element once per X minumum other elements have been added), etc.
I love that idea! Getting random elements get verbose in a hurry!
public static T GetRandom(this List list)
{
return list[Random.Range(0, list.Count)];
}
This is pretty nifty. Thanks 👍
Very cool stuff! I had no idea this was even possible, and so easily! Cheers
Prefer written tutorials? Here's the blog post for the video: onewheelstudio.com/blog/2021/7/14/c-extension-methods
Project File: github.com/onewheelstudio/Adventures-in-C-Sharp/tree/main/ExtensionMethods
Wow, this is really useful - thanks for posting!
Nice video, please keep doing more.
Life saver and Useful!!! 😄
Thanks for the nice video !
Wow! Thank you so much. You explained it very clearly!
Waiting for a video of writing proper managers without singletons.
Events and static functions! But mostly events! :)
I have at least a dozen managers in my personal project and not a single use of the Singleton Pattern. It's not always a bad pattern, but I think it is mostly used to communicate between managers. A lot of that communication can be done with events that doesn't cause massive coupling of different classes.
All that said, this could be a cool idea for video! Any problems in particular you've run into? Problems you are trying to solve?
@@OneWheelStudio I have used singletons to create managers but it has dependencies as project grow I just want to know if there is proper way of doing it.
Thank you for the information.
Yeah. That does happen. If you aren’t familiar with it check out the observer pattern - ie events, actions and delegates
@2:35 i did not get, where you got vectorFloat from: vectorInt = vectorFLoat.TOvector3Int(); could you please elaborate a bit more :)
"vectorFloat" is just a name of a variable of the type Vector3 - just the usual type nothing special. I named it that to try and make a clear separation between the float and integer version of Vector3.
@@OneWheelStudio Thank you, now i understand :D