Beginning C# with Unity (2023 Edition) - Types

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2024
  • C# contains lots of different types that you use to build your games. In this episode, you'll get an overview of the simple types and how to use them. Afterwards, there is a brief challenge to test your knowledge.
    This episode is sponsored by www.kodeco.com.
    Note: Unity is required. You can download the free version from Unity3d.com. This course has been developed using just the personal version.
    Kodeco aims to be the best online learning platform for mobile developers at every step of their career, all the way from building your first app, to becoming a respected expert in your field.
    Previously known as raywenderlich.com, our products have made a difference in the lives of thousands of developers across the world, helping them to get their first job as a mobile developer, grow their careers as part of a dev team, or create the app of their dreams.
    About Unity (from Wikipedia):
    Unity is a cross-platform game engine developed by Unity Technologies and used to develop video games for PC, consoles, mobile devices and websites. First announced only for Mac OS, at Apple’s Worldwide Developers Conference in 2005, it has since been extended to target more than fifteen platforms.
    It is now the default software development kit (SDK) for the Wii U.]Unity Pro is available for a fee and Unity Personal has no fee; it is available for any use to individuals or companies with less than US$100,000 of annual gross revenue.
    On March 3, 2015 with the release of Unity 5.0, Unity Technologies made the complete engine available for free including all features, less source code and support.
    Unity is noted for an ability to target games to multiple platforms.Five versions of Unity have been released. In 2006 at the 2006 WWDC trade show, Apple, Inc. named Unity as the runner-up for its Best Use of Mac OS X Graphics category.
    About C#:
    C# (pronounced as see sharp) is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
    It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages designed for the Common Language Infrastructure.
    C# is intended to be a simple, modern, general-purpose, object-oriented programming language. Its development team is led by Anders Hejlsberg. The most recent version is C# 5.0, which was released on August 15, 2012.

ความคิดเห็น • 84

  • @Isotonicdev
    @Isotonicdev 7 หลายเดือนก่อน +26

    6:50 ah yes, "lovingRelationship = false" , very relatable

  • @Crazyskeleton921
    @Crazyskeleton921 26 วันที่ผ่านมา +1

    Fellas I did it I finished the challenge and fixed the problems on my own! Im hitting the big league!

  • @CreeperKiller420
    @CreeperKiller420 11 หลายเดือนก่อน +16

    The challenge at the end of this video was very fun! Thank you so much. You are a great, fun teacher.

    • @sebo_lifts
      @sebo_lifts 8 หลายเดือนก่อน

      guhhh guuhhh, glazinggggggg

    • @ixrym9678
      @ixrym9678 7 หลายเดือนก่อน +3

      @@sebo_lifts fr tho

  • @tigerjustice
    @tigerjustice ปีที่แล้ว +6

    Thank you. I study C# with your lessons

  • @ammysth9315
    @ammysth9315 3 หลายเดือนก่อน +1

    you managed to make coding fun with that random fact and boolean type :) you are a great teacher

  • @TheYetza88
    @TheYetza88 8 หลายเดือนก่อน +1

    I made so many mistakes with this short video, it took me 2 days to fix everything 🤦🏼‍♀but it was all part of my learning process, thank you for these videos, are super usuful and I feel that I am learning a lot

    • @VegetarianZombie
      @VegetarianZombie  8 หลายเดือนก่อน +2

      The only way to be good at something is to be bad at something. Mistakes are painful but it's truly the way we learn. Keep up the awesome work!

  • @GL1TCH43V3R
    @GL1TCH43V3R 2 หลายเดือนก่อน

    This has been such an enjoyable course so far. I really enjoy the assignments at the end of each lesson. It's nice to practice without simply following along. It helps me to remember things.
    Anyway, I just wanted to say thanks for all your hard work in making this course. It's certainly appreciated and incredibly helpful to beginners like myself.

  • @UnrealCraft
    @UnrealCraft ปีที่แล้ว +4

    Another great video! The example was a great way to show the types in action.

  • @BRINDANI2000
    @BRINDANI2000 3 หลายเดือนก่อน

    At first I thought the numbers weren't going to work because they aren't casted in the statement but it looks like it knows what to do with other types so awesome new find.

  • @delaneyb6171
    @delaneyb6171 23 วันที่ผ่านมา

    thanks for making these videos :) you are a great teacher

  • @gitarmats
    @gitarmats ปีที่แล้ว +1

    So far so good! Still don't understand everything I'm doing, but I understand a bit more with each video.

  • @jake221
    @jake221 ปีที่แล้ว +2

    Great video can't wait for the next one!

  • @nguyenthetan1332
    @nguyenthetan1332 2 หลายเดือนก่อน

    Your humor is something else

  • @DevikenGames
    @DevikenGames ปีที่แล้ว +2

    Thanks sir,please keep going your amazing job,i hope you will make a serie for making games examples later on this channel.

  • @weststine5558
    @weststine5558 ปีที่แล้ว +1

    Thank you. You've got my subscription. But I have one I have one suggestion based off an incredibly frustrating problem I encountered. My Visual Studio wasn't giving me code completion options or error messages and it was driving me crazy. I finally found a solution after a couple hours of trying different fixes. And that solution was in your 3rd video. For some reason when I install everthing it didn't set VS as the preference, but would still open it everytime I went to code. Maybe link video three to the first one for people having the same issue. Any thanks this Thank you again. I've only been writing code for about 5 days now and is is much more instructive then the previous tutorial I was fighting to learn.

  • @Siggney1
    @Siggney1 10 หลายเดือนก่อน +1

    i did the challenge and was able to make it so i could change them in unity like the hello world tutorial :)

  • @kawaii2811
    @kawaii2811 หลายเดือนก่อน

    I did the solution on my own and figured I could just use strings for everything since we aren't doing any calculations with the numbers.

  • @cyclopsshaman.2204
    @cyclopsshaman.2204 6 หลายเดือนก่อน +1

    I messed up one step and it took two hours to fix it. The euphoria of seeing text pop up on my screen is going to be a bit addicting innit?

  • @BetmenBoy
    @BetmenBoy ปีที่แล้ว +2

    thank you so much sir, great tutorial for a beginner like me.. thankss...👍

    • @VegetarianZombie
      @VegetarianZombie  ปีที่แล้ว +1

      I'm so glad these are helping. Soon we will get to the part where we actually use this stuff to make a game :)

  • @jameswood9242
    @jameswood9242 9 หลายเดือนก่อน

    I just noticed you have a number of similarly named videos from 8 years ago. Are you updating those with this new series? I'm just wondering what you would recommend I go on to when finished #11 on Enumerations?
    Great videos and exercises. Well paced, lots of good info practically presented.

  • @Brxxzzy
    @Brxxzzy 7 หลายเดือนก่อน +1

    i might be late but 16:50 the anotherNoun is supposed to be adjective i think

  • @Richmond1226
    @Richmond1226 ปีที่แล้ว +1

    I will be looking forward watching this series so by the time you are done i can make a game

  • @kotaybapro5123
    @kotaybapro5123 ปีที่แล้ว +1

    Thank you🙏❤

  • @fredianafiona8961
    @fredianafiona8961 ปีที่แล้ว

    Thank youu!! This helped me a LOT!

  • @rasya5425
    @rasya5425 ปีที่แล้ว

    Great video! It really helps thankyouuu

  • @Justin-cx8lv
    @Justin-cx8lv ปีที่แล้ว

    Thank you!

  • @duhslimshadow7985
    @duhslimshadow7985 ปีที่แล้ว

    Thank you!!!

  • @WickedNoPoint
    @WickedNoPoint ปีที่แล้ว

    this is a great help, I really enjoy the sort one concept lessons with a task at the end. though in my solution I wrote the bool as [ public bool statement = !(false && true); ] so you could more readily change between true and false within the unity editor and same sorta idea with the int and float by not explicitly setting them to any value [ public int Number; ] [ public float percent; ] and it seems to work great.

  • @Siggney1
    @Siggney1 10 หลายเดือนก่อน +3

    when would a private string or whatever be used? why would you want your game to not be able to access a part of the code?

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS 2 หลายเดือนก่อน

      Maybe if your working in a group and you want to make sure the number is never changed by anyone else, or maybe if your game has some sort of command line thing or whatever like Minecraft or the Doom games and you don't want anyone to figure out how to change certain numbers that could allow for cheating or something, idk, developers probably rarely ever use the "const int" type, I've been using Unity for about 4 years and I've never even heard of all of these besides. String, Int, and Float, those are the only 3 I have ever used for numbers

  • @gobbelgub4031
    @gobbelgub4031 13 วันที่ผ่านมา

    when he also typed "clowns" i squealed

  • @Disconly
    @Disconly หลายเดือนก่อน

    the challenge was fun I got "The statement is False. I did not kill the man. I am not guilty. I am an innocent person. The act was performed by 2 wandering Criminals. I am 100% sure of this " I changed the sentence a bit tho

  • @themapletree2310
    @themapletree2310 ปีที่แล้ว

    amazing

  • @monstertrident7030
    @monstertrident7030 ปีที่แล้ว

    Keep cookin king 👑

  • @swapnilsahoo6666
    @swapnilsahoo6666 ปีที่แล้ว +3

    I actually thought you asked for the challenge to make us write the input in unity and then give them values... So i did just that
    Can you say its a challenge completed😅😅

  • @felipeleon8614
    @felipeleon8614 ปีที่แล้ว

    I did not "eat" the "mustache"
    Me: 🤔🤔🤔
    great tutorial by the way😊

  • @hen0botx472
    @hen0botx472 6 หลายเดือนก่อน

    isnt that first integer the max shotgun ammo glitch in fortnite (im not addicted i just have a good memory)
    looked it up, it isnt but the the 2,147,483 part is, its just the hundred ten and one values that are off

  • @MrRyanholder
    @MrRyanholder ปีที่แล้ว +1

    When is it necessary to specify public/private when assigning a variable? When I wrote the challenge I didn't type out public before assigning any of the variables but it seemed to work fine in unity.

    • @Chubzdoomer
      @Chubzdoomer ปีที่แล้ว +1

      public = Any other class can access the variable.
      private = Only the class the variable is in can access it.
      Another common one you'll see is 'protected' which means the variable can be accessed by both the class it's in AND any sub-classes that derive from that class. As a beginner that one will probably go over your head until you become more familiar with class hierarchies, inheritance, etc. though.

    • @MrRyanholder
      @MrRyanholder ปีที่แล้ว

      @@Chubzdoomer Ok, but when do you need to specify that a variable is private/public rather than just stating the variable without specifying private/public?

    • @Chubzdoomer
      @Chubzdoomer ปีที่แล้ว +2

      @@MrRyanholder Variables that aren't preceded by anything are private. (In other words, the private keyword is completely optional.)

    • @Tech_and_Treasure
      @Tech_and_Treasure ปีที่แล้ว +1

      ​@@Chubzdoomerthank you, I needed to know this.

  • @jamesweaver-lj2fj
    @jamesweaver-lj2fj 6 หลายเดือนก่อน

    so i was messing with bool and code completion taught me something, it turns out C# doesn't think dogs can look up.

  • @savitarplayzeverything880
    @savitarplayzeverything880 ปีที่แล้ว +1

    your humor sense thoo🤣😂

  • @CosplayZine
    @CosplayZine 11 วันที่ผ่านมา

    " error CS0029: Cannot implicitly convert type 'string' to 'bool' "

  • @schoolrulez
    @schoolrulez 3 หลายเดือนก่อน +1

    I started laughing my ass off at the Boolean examples

    • @DARK_AMBIGUOUS
      @DARK_AMBIGUOUS 2 หลายเดือนก่อน

      Poor Boolean guy

  • @UGSETH2
    @UGSETH2 6 หลายเดือนก่อน

    "The statement is false. I did not kill the dog. I am an innocent person. The act was performed by 25 wandering Cowboys. I am 39.7% sure of this"
    Thanks for the lesson

  • @willwonderz
    @willwonderz 9 หลายเดือนก่อน

    Do you have any idea why my font isn't the same colour as yours?

  • @LordOfDaTurkeys
    @LordOfDaTurkeys 11 หลายเดือนก่อน

    for all those lazy people (me being one of them) who don't wanna type the entire string for the challenge here it is:
    $"The is statement is {statement}. I did not {verb} the {noun}. I am not guilty. I am a {adjective} person. The act was performed by {number} wandering {pluralNoun}. I am {percent}% sure of this.";
    Of course it is preferred you write the entire thing but if you want you can copy and past the above.

  • @TirosAssetstore
    @TirosAssetstore ปีที่แล้ว

    If you have any issues with this: sometimes the script must be reassigned.

  • @Ghost-Toast819
    @Ghost-Toast819 10 หลายเดือนก่อน

    so i successfully filled in the values in the mad lib but i ran the program with my bool saying true instead of false. I tried to change what the code said but failed to make the change i wanted. is there some extra step i missed to fix the mistake?

  • @mr.redflag
    @mr.redflag ปีที่แล้ว +1

    You cheeky little 😂 there's no way you made me type that.

  • @aliibrahim6407
    @aliibrahim6407 3 วันที่ผ่านมา

    my bool statement is false but when i run the game its shows true

  • @Manciek_
    @Manciek_ ปีที่แล้ว

    Channel name changed?! I liked the old one "Vegetarian Zombie"

    • @VegetarianZombie
      @VegetarianZombie  ปีที่แล้ว

      I hear ya - the full title is Learn Create Play with Vegetarian Zombie. I've been getting a ton more learning subs so I wanted clarify what the channel covers. But thanks for the feedback!

  • @silver5866
    @silver5866 11 หลายเดือนก่อน

    6:56 Number Types

  • @franks3793
    @franks3793 ปีที่แล้ว +1

    Why the new channel name idu?

    • @VegetarianZombie
      @VegetarianZombie  ปีที่แล้ว

      I'm changing the focus of the channel to be more "game dev" (Unity, Skyrim modding), and less "let's play" although I will still be doing LPs.

  • @Okbagr
    @Okbagr 10 หลายเดือนก่อน

    the percentage doas not appear in the game

  • @redresultyt
    @redresultyt 9 หลายเดือนก่อน +2

    wetClothesKill = true; Haha shit is so funny

  • @BugEnthusiast
    @BugEnthusiast ปีที่แล้ว +1

    All I'm getting are compiler errors, sigh. This would be a whole lot easier if I weren't an idiot. I guess ill just watch the rest of the series without following along.

  • @holaholahee
    @holaholahee ปีที่แล้ว

    6:40 LOOOL WTF

  • @MackSecondchance
    @MackSecondchance หลายเดือนก่อน

    Am I the only one who talked about stealing the moon in the challenge?

  • @AmazingBuildsTutorials
    @AmazingBuildsTutorials 2 หลายเดือนก่อน

    loved the video but, umm. Strings contain text, not cheese.
    Cheese can contain strings...

  • @Zehave
    @Zehave ปีที่แล้ว +4

    public bool lovingRelationShip = false; 💀💀

  • @unpopularcritic
    @unpopularcritic ปีที่แล้ว +1

    If you're getting an error then this is the fix:
    textMeshPro = GetComponent(); // Assign the result of GetComponent to textMeshPro
    Best of luck!

  • @Loonima
    @Loonima ปีที่แล้ว

    « The statement is False. I did not Eat the young man! I am not guilty, I am just a Crazy man! The acted was performed by 12 monkeys and I am 33% sure of it. » 😂

  • @yvonnevierra2715
    @yvonnevierra2715 9 หลายเดือนก่อน

    Jenny Jenny

  • @greenamigothegamer6289
    @greenamigothegamer6289 3 หลายเดือนก่อน

    Why do you remember pi by memory??? why???
    BTW Wonderful videos, my dream has always been the one to put my creativity at work by making videogames and your course is simple and effective, i only programmed with python and moving to this is really comfy, you are a clear explainer. THX

  • @druidsunionvods
    @druidsunionvods ปีที่แล้ว

    // on the line:
    textMeshPro = $"The is statement is {statement}. i did not {verb} the {noun}. i am not guilty i am a {adjective} persom. The act was performed by {number} wandering {pluralNoun}. i am {percent}% sure of this.";
    // i am running into this error in the code: "Cannot implicitly convert type 'string' to 'TMPro.TextMeshProUGUI' [Assembly-CSharp]csharp(CS0029)"
    I cant really pin-point the problem, as far as i can tell my code is a duplicate of the test example beyond the varaibles.

  • @danpostica898
    @danpostica898 ปีที่แล้ว +1

    public string words = "Thank You VERY MUCH" ;
    textMeshPro = GetComponent();
    textMeshPro.text = $"{words}";
    I think i did every thing correctly :).