Unity Editor Layout | First C# Script | Unity Log Messages | .NET Assemblies - Unity C# Scripting 0
Unity Editor Layout | First C# Script | Unity Log Messages | .NET Assemblies - Unity C# Scripting 02
Notes for You::
0:00:00 How to Customize Unity Layout: https://youtu.be/DBqSNJwz2a4
- Unity gets open with initial layout
Layout:
- is arrangement of panels
Layouts Dropdown Button from ToolBar:
- gives access to all layouts [2 by 3, 4 Split, Default, Tall, Wide]
- allows us to Save, Delete and Reset Layouts
0:02:46 How to Create and Execute First C# Script in Unity: https://youtu.be/DBqSNJwz2a4?t=166
Step 1. Create Scripts folder
- Right click on Assets folder in Project panel
- Go to Create - Click on Folder option.
- Name it [Scripts].
Step 2. Create C# Script
- Right click on Scripts folder
- Go to Create - Click on C# Script option.
- Name it [FirstScript] by following Pascal case naming convention.
Step 3. Open C# Script
- Double click on FirstScript.
- Unity opens the file in default script editor known as MonoDevelop or Visual Studio.
Mono Develop ( IDE ) :
- We edit, compile, run and debug all our c# codes in MonoDevelop or Visual Studio.
Step 4. Type the code
- Type print("Hello Unity"); in Start method. Save File.
Step 5. Attach Script to MainCamera
- Select Main Camera,
- Go to Inspector panel - Click on Add Component button
- Click on Scripts - Select FirstScript for execution
OR
- Drag and Drop FirstScript on to MainCamera
Step 6. Execute the Script
- Click on the Play button to execute the code or stop the execution of code.
Note: For execution MonoBehavior Scripts must be attached to some game object.
0:09:13 Why should we save a Unity project before exit: https://youtu.be/DBqSNJwz2a4?t=553
- We must and should save Unity Project before closing it; because any modification done to the game objects in the scene are not saved.
0:15:58 Understand Unity Log Messages and Errors: https://youtu.be/DBqSNJwz2a4?t=958
1. Log messages :
- print or Debug.Log methods are used to display log messages
- Log messages are used for debugging purpose
2. Error Messages :
A. Syntax Errors:
- Syntactic errors are handled by Unity (parsing error)
Ex: Missing semicolon, etc.
B. Logical Errors:
- Logical errors are handled by programmers (with Debugger tool)
Ex: Not reducing player health
C. Runtime Errors: Exceptions
- Runtime errors handled by programmers (with Exception handling)
Ex: Array index out of bounds, divided by zero etc.
3. Warning Messages:
- Indicate may create problems later.
Ex: Variable initialized but not used.
Note:
You cannot run the project if it has error message.
You can run the project if it has warning messages.
0:24:27 Understand first Unity C# Script in depth: https://youtu.be/DBqSNJwz2a4?t=1467
Example Program:
- C# program to print "Hello Unity" in Console panel
using UnityEngine;
public class FirstScript :MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
print("Hello Unity");
}
}
public:
- is access modifier makes the class available publicly (i.e. to Unity engine)
class:
- is keyword for defining a class and in C# everything should be part of a class.
Colon symbol(:)
- indicates extends in C#
MonoBehaviour:
- As print method is defined within MonoBehaviour class; We must extend our class with MonoBehaviour.
- Convert our class as a component so that we can attach it to game object for execution.
using UnityEngine;
- MonoBehaviour class is present inside UnityEngine namespace; Hence using UnityEngine;
print() :
- Logs message to Unity Console (Identical to Debug.Log)
Start(){} :
- is called when a script is enabled just before any of the Update methods is called the first time.
Update(){} :
- is called every frame, if the MonoBehaviour is enabled.
0:36:00 Understand .NET Assemblies: https://youtu.be/DBqSNJwz2a4?t=2160
- Assembly is a file that is automatically generated by the compiler upon successful compilation of every .NET application.
There are 2 kinds of assemblies in C#:
1. DLL (Dynamic Link Library):
- collection of namespaces
- DLL files are not self executable
- Example DLLs : mscorlib.dll, UnityEngine.dll
2. EXE (Executable):
- EXE files are self executable
Library:
- Library is a collection of namespaces.
- Namespace is collection of other namespaces and data structures (like Classes, structures, events etc.)
Ex:
UnityEngine.dll contains UnityEngine namespace contains MonoBehavior Class.
=========================================
Follow the Link For Next Video:
https://youtu.be/LD3tSxSp8B4
Follow the Link For Previous Video:
https://youtu.be/hoBDMyEV9sw
=========================================
Unity C# Scripting Tutorials Playlist:-
https://www.youtube.com/playlist?list=PLdE8ESr9Th_vfn7aSIzAkudVRTLntF18w
=========================================
Subscribe to our YouTube channel:-
https://www.youtube.com/chidrestechtutorials
=========================================
Hash Tags:-
#ChidresTechTutorials #UnityCSharpScripting #UnityScripting #Unity
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Unity Editor Layout | First C# Script | Unity Log Messages | .NET Assemblies - Unity C# Scripting 0», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.