Unity Tutorial: Generics

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 16

  • @Nomarr
    @Nomarr Před 3 měsíci +3

    generic + interfaces are the best 👏

    • @IainTheIndie
      @IainTheIndie  Před 3 měsíci

      Absolutely! It's a bit more setup often but I definitely find it pays off long term on a project.

    • @Legionope
      @Legionope Před 2 měsíci

      I can't wrap my head around where to use this. What's it's most commonly used case? For dialogue system? Player controller? Inventory system?

    • @IainTheIndie
      @IainTheIndie  Před 2 měsíci +1

      @Legionope the main use cases will be situations where you have multiple similar, but different, classes that you're needing to work with. So an inventory would be a good use case where you might have a base interface for an inventory item that defines things like size/weight etc but then have versions for consumables, wearables etc.
      For a character controller if you want to have things be more modular or have a mix of ones (player, AI etc) then interfaces could work there as well.

  • @TheKr0ckeR
    @TheKr0ckeR Před 3 měsíci +2

    Great guide, I would really prefer adding T keyword before defining the name like TItemType, its much more understandable. For a second, i thought its an enum where you pass a enum data to a generic class.

    • @IainTheIndie
      @IainTheIndie  Před 3 měsíci

      Thankyou! And, yep I think that's a very valid point. I think with me having come from C/C++ to C# I tend to prefix enums with E (because of how C/C++ worked with them) but not for generics/templates. It would definitely help with clarity of the code to prefix both enums and the generic types.

  • @hop3studio511
    @hop3studio511 Před 2 měsíci +1

    may i request for setup github for unity project tutorial?, i know there is a lot out there, but for me they just seems not the best way to teach it, either to rush, or simply read from book or something, unlike you sir

    • @IainTheIndie
      @IainTheIndie  Před 2 měsíci +1

      I've added it to my tracker for ones to cover. It likely won't be soon but I agree it would be a good area to cover and in particular look at a few of the different tools available for working with it.

    • @hop3studio511
      @hop3studio511 Před 2 měsíci +1

      @@IainTheIndie thanks, I'll wait for it

  • @kucirulz
    @kucirulz Před 2 měsíci

    What would be the preferred way to contact you? Patreon discord? I would like to get some help for which I would gladly compensate you.

    • @IainTheIndie
      @IainTheIndie  Před 2 měsíci +1

      Via Patreon etc is usually going to be easiest. I'm not in the position currently to be able to be assisting much beyond answering brief questions though. It's a very busy period so time is pretty limited.

    • @kucirulz
      @kucirulz Před 2 měsíci +1

      @@IainTheIndie I see, thank you for the reply!

  • @chiragsawajiyani8540
    @chiragsawajiyani8540 Před 2 měsíci

    Hi, I am working on a unity game in which we have to untangled girl hair breds. How I can make this untangled mechanism for mobile.

    • @IainTheIndie
      @IainTheIndie  Před 2 měsíci

      Hi, unfortunately that’s not an area I’ve worked on anything even close to it. I suspect your best option might be to look into areas like simulating ropes.

    • @chiragsawajiyani8540
      @chiragsawajiyani8540 Před 2 měsíci

      @@IainTheIndie any idea you have related to rope physics or rope simulation

    • @IainTheIndie
      @IainTheIndie  Před 2 měsíci +1

      @chiragsawajiyani8540 it’s not an area I’ve worked in really and the few bits I did were a long time back. I’d recommend researching into rope and hair simulation both in general and in Unity specifically