C# Classes in Unity! - Beginner Scripting Tutorial
Miễn phí 0 Quizzes
1 bài giảng 30/11/2026
Khóa học trực tuyến • Giảng viên: Unity • Ngày tạo: 30/11/2026

C# Classes in Unity! - Beginner Scripting Tutorial

Mô tả

Watch this video in context on Unity Learn: https://learn.unity.com/tutorial/clas... How to use Classes to store and organise your information, and how to create constructors to work with parts of your class.

Danh sách bài giảng (1 bài)

1

Bài 1: C# Classes in Unity! - Beginner Scripting Tutorial

Video bài giảng
Đăng ký để học

Bài kiểm tra Quizzes (0)

Chưa mở khóa
Khóa học này chưa có bài kiểm tra trắc nghiệm nào được mở.
Đánh giá & Phản hồi

Đánh giá từ học viên

Nhận xét và trải nghiệm thực tế từ các học viên đã đăng ký tham gia khóa học này.

4.8 / 5

Dựa trên 10 lượt đánh giá từ học viên

5
8 (80%)
4
2 (20%)
3
0 (0%)
2
0 (0%)
1
0 (0%)

Đăng nhập để đánh giá khóa học

Bạn cần đăng nhập và tham gia khóa học để có thể gửi đánh giá và nhận xét.

Đăng nhập ngay →

Tất cả đánh giá 10

@leonardofraga5130
3 ngày trước

One of the most important principles of OOP is single responsibility. Try to make "as many scripts as you can" following the single responsibility rule. Try to make one script take care of one task only. For instance, for my player I have one script to control its particles, another to control sound effects, another to control animations, another to control movement, another to control death, and so on...

That way it's easier to:

1 - Find bugs and fix them
2 - Add new things, a.k.a scalability (really important creating games)
3 - Organize things
4 - Being able to take off things without breaking everything
5 - It will be much easier to come back to old scripts that you don't see for ages
6 - People will think "This guy knows his OOP!"

Instead of building a Jenga tower, you just lay

@JustOneHappyBoiii
3 ngày trước

"Shoot small objects"
yeets a giant watermelon

@jaypark2177
3 ngày trước

I don't understand constructors... As a visual learner of how what code does what in real game, I don't understand why you have three projectiles (there's only one type of projectile in the examplew which is the watermelon) and what the whole point of the script example is, it seems so detached from the example game.

@Gomace
3 ngày trước

So it's a bit like how Instantiate has different parameters based on what variables you give it? That's cool!

@Winnders
3 ngày trước

i was confused as to how he could pipe projectileA into the same class twice.
prA, prB, prC in one, and
prA and fuel into the other.

He is putting 50 into both projectileA slots, so i wondered what would happen if you change one of those 50s? Which one will it do first?

BUUTevery time he calls it, hes storing it into a different variable (myStuff/myOtherStuff)

So if you change the numbers going into both, it doesnt matter, because youre calling on it with different variables, so theyre actually 2 different things entirely. I guess thats what instance means..

Anyways just thought id share cus that confused me initially.

@ChauNezuko
3 ngày trước

Wow, one of the best lecture
/tutorial I ever watch, some confusing things are solved immediately. Thank you very much.

@BlackJar72
3 ngày trước

Uses an inner class; doesn't mention what he's doing or his rationale for doing so.

@cuteduck_quack
3 ngày trước

I just came here to understand how to call classes dynamically and for example leave my recoil class unopened/unused and therefore the parameters in it set to 0 or alike when i call my laser class but i still want to include the recoil class when i shoot a gun or launch a missle. Somehow tickboxes appear in this Script, but i really don't know why

@mr_abex7579
3 ngày trước

what should I do if unity don't automatically put public classes in the script for me?

@paulbelfrage
3 ngày trước

I'm planing to uses this in my classroom. I hope "Teaching Game Design and Development" and "Create with Code" is not getting removed for a couple of years?

Đăng nhập để báo cáo

Bạn cần đăng nhập tài khoản để có thể báo cáo bình luận này.

Đăng nhập