Static vs Instances | Unity C# Basics Part 4

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ค. 2024
  • Learn about what "instance"s are, what's the difference between those and "static", and a common design pattern that uses both of these! If you've been following along in the series, you've already used both instances and static properties, maybe without knowing it! Today you will learn about what each one is and when you should use static or an instance. We'll also review the limitations of each type to deepen your understanding!
    If you've been using Unity for a while, or are just getting started with Unity and decided it's time for you to start learning how to write code - this is the video series you need to start your programming journey!
    💸 Ongoing sales 💸
    ⚫ See all active asset sales on the Asset Store: assetstore.unity.com/?on_sale...
    ⚫ Save 25% off your first Asset Store Order: prf.hn/click/camref:1101l9QvC...
    ⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
    👨‍💻 Unusually, this video does NOT have a project associated with it. For reference, you can view the project from the last video on GitHub: github.com/llamacademy/unity-...
    Full Series Playlist Here: • Want to Start Writing ...
    ⚫ Part 1 - Writing your first script - • Want to Start Writing ...
    ⚫ Part 2 - Loops and Arrays - • Loops and Arrays | Uni...
    ⚫ Part 3 - Unity Component Lifecycle - • MonoBehaviour Lifecycl...
    ⚫ Part 4 - Static vs Instances - • Static vs Instances | ...
    ⚫ Part 5 - Delegates - • Delegates? Basically, ...
    ⚫ Part 6 - Inheritance & Interfaces - • Inheritance and Interf...
    ⚫ Part 7 - Compositional Relationships - • Compositional Relation...
    📝📝📝YOUR HOMEWORK!📝📝📝
    Create a static function that will create a prefab at a given location.
    Bonus: Make it a singleton class with a local / instance function instead of a static function!
    Add a comment below with a video showing your code and the end result.
    ❤ Believe in LlamAcademy's mission and have received value from the videos? Become a Patreon Supporter or TH-cam Member:
    ⚫ Patreon: / llamacademy
    ⚫ TH-cam Member: / @llamacademy or click the Join button on any video
    📚 Here are the resources I mentioned and/or brought up during the video 📚
    ⚫ "this": docs.microsoft.com/en-us/dotn...
    ⚫ "static": docs.microsoft.com/en-us/dotn...
    ⚫ Static classes: docs.microsoft.com/en-us/dotn...
    ⚫ Screen: docs.unity3d.com/ScriptRefere...
    ⚫ Singleton: en.wikipedia.org/wiki/Singlet...
    ----
    Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
    I also have some Unity Assets (affiliate link): assetstore.unity.com/publishe...
    Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
    #unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment #learntocode
    Chapters:
    00:00 Introduction
    01:43 "this" Keyword
    03:15 Static vs Instance Variables & Static Restrictions
    08:30 Static vs Instance Functions
    09:27 Static Classes
    10:18 Controversial Design Pattern
    12:47 Homework!

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

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

    Came from Reddit. Gonna watch it sometime this week and will leave feedback. I’ve been looking around for C# tutorials for absolute dummies like myself. Cheers mate!!

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

    Thanks for this! It was a very clear explanation that I needed a refresher on. 10/10 would learn again (and probably have to later).

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

    Incredible discovery of this channel. Subscribe for sure. Thank you

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

    I couldnt understand mostly of the video so im going to repeat it until i have the essential knowlege to do the homework.

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

      If you have questions after going through it, please feel free to ask them!

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

    i dont really understand why i would use static over instance and how to know. im a complete beginner so my knowledge on this kind of stuff is very limitted!