Unity introductory tutorial (very detailed) from zero-based entry to proficiency, it is enough to read this article


foreword

   伴随游戏行业的兴起,unity引擎的使用越来越普遍,本文章主要记录博主本人入门unity的相关记录大部分依赖siki学院进行整理。

1. Know the unity engine?

1. Unity-related information:

 Unity的诞生:https://www.jianshu.com/p/55021d9301ab  
 Unity的应用:https://baike.baidu.com/item/Unity/10793?fr=aladdin  
 Unity发展:https://baike.baidu.com/item/Unity/10793?fr=aladdin#3

2. Download and install:

The software used in this learning application is mainly: unity2021.2.10flc1 and VS2019 version

(1) Relevant download address:

Unity China official website unity.cn
International official website unity.com (requires scientific Internet access)
official website: www.unity.com

(2) Related download tutorials:

Unity:https://zhuanlan.zhihu.com/p/433418045
Vs2019:建议在siki学院《Unity2021零基础入门学习教程 - RollABall》课程资料里下载

(3) Regarding the version description of unity:

 LTS(Long Term Support)——长期支持版本  
 Alpha——内测版  
 Beta ——公测版(不稳定,有最新功能,最新更新)  
 关于不同版本的解释:https://blog.csdn.net/zistxym/article/details/99300504

2. Basic knowledge of Unity

1. Create a project

(1) Click on the Unity hub and create a new one
insert image description here

Tip: If you cannot create a new one, it may be that you are not logged in and have not activated a license. The operation is as follows
insert image description here

2. Project catalog introduction

After the creation is completed, relevant project files will be generated in the created directory
as shown in the figure:
insert image description here
Assets: Resources (scene script model)
Library: Library (system)
Logs: Log
Packages: Imported packages
ProjectSettings: Project settings
Temp: Temporary files ( If the file is too large, you can delete part of the cache)
UserSettings: Settings

3. Five window panels

After the creation is complete, there will be 5 window panels (red boxes)
5 window panels
Project : Project panel, which stores various resources of the project. Including: sound resources, model resources, scene files, materials, scripts, etc.

Hierarchy : Hierarchy panel, showing what is in the currently opened scene. (Things inside are called game objects)

Inspector : Inspect the panel (or property panel) to see which components a game object is composed of.
Scene -> multiple game objects -> multiple components

Scene : Scene panel, showing what the current scene looks like
Middle mouse button: Pan the view
Right mouse button: Rotate the view (look around), rotate around itself
Alt + left mouse button: Render the view, around the front position of the current view

Game : The game panel, what it looks like when the scene is running

The meta file under the Scene file cannot delete
insert image description here
the layout in the upper right corner, and the layout can also be modified
insert image description here

4. Create code and scenes

(1) Right click on Project > Assets and select create to create a C# script, and rename it to "New Name" and right click to open it

     Unity支持持的编程语:C#、Mono、JavaScript 

insert image description here

(2*) If you use other versions of the compiler, you need to specify it separately / the code does not prompt, you can also use this method to solve it

Edit > Preferences > External Tools (additional tools)
in the External Script Editor, there are two options
Open by file extension——according to the file extension, use the corresponding tool to open
Microsoft Visual Studio 2019 (this is the compiler installed by yourself)
select "Microsoft Visual Studio 2019" because most of the files in unity are C#

insert image description here
insert image description here

5. Basic model and scene operations in Unity

(1) How to create a basic model and how to import a complex model

(2) Basic scene operations

 聚焦:双击游戏物体 或者 F  
 放大缩小视野:鼠标滚轮  
 围绕物体旋转:Alt+鼠标左键  
 使用MoveTool下 移动物体

(3) Field of view classification

 Persp 透视视野 ISO平行视野  
 在不同视野下:关于鼠标右键的不同

(4) Save (scene save, code save)

 Ctrl + S

6. World coordinate system and local coordinate system

Coordinate system : x, left, right, y, up and down, z, front and back Local
coordinate system : parent object and child object
Unit : Coordinates in Unity are in meters

7. Toolbar

(1) Four tools

 Q:视图工具(使用鼠标中键可以临时切换到这个恐惧)  
 W:移动工具  
 E:旋转工具  
 R:缩放工具  

insert image description here

(2) Other tools

 Rect Tool Transform Tool Collider Tool  

insert image description here
Rect Tool: modify the size - general 2D game use

 Transform Tool:WER同时调出

 Collider Tool:碰撞器

(3) Switch tool

 位置工具:Pivot原点 - Center中心  

Pivot origin Center Center
Local and global coordinate switching: Local - Globa

(4) Switch tool and move tool

 步移工具:一段一段数值移动(快捷键:Ctrl)  
 条件:世界坐标系下  
 ![在这里插入图片描述](https://img-blog.csdnimg.cn/a9cff43926fc406397d29b4cc5f4a689.png)  
 位置工具:Pivot原点 - Center中心  
 局部和全局坐标切换:Local - Global

3. Practical operation of the case

1. Create a scene

 在project面板右击"Scenes"文件create>scence  

insert image description here

(1) Create the ground

①Click the created "Main Scene"
②Right click on the 3D object>Plane in the Hierarchy panel

insert image description here

③Click on Plane, and the inspector panel will display the related object properties.
Position is set to (0.0.0) and
scale X, Z is enlarged by 2 times.
④Create a material to change the color and material of the Plane.
Create a file "Materials" under the assets file. Right-click this file to create Ground material
insert image description hereinsert image description here

Tip: The created Materials component can also be directly dragged to any object in the scene. You
can also click on the target object in the "Inspector" panel to add the Materials property.

 Mesh Filter:控制形状模型  
 Mesh Renderer:在网格上渲染  
 smooththness:控制光滑程度(值越大越光滑)  

insert image description here
For example: smooththness is 1
insert image description here
smooththness is 0
insert image description here

Relationships between related sectorsinsert image description here

(2) Create a wall

Tip: The created Materials component can also be directly dragged to any object in the scene

①In the Hierarchy panel, right-click 3D object>Cuba
②Create a cube and rename it "wall", adjust the "Scale" of the cube and add materials as needed

insert image description here

*(3) Prefabricated body

Create multiple identical objects, you can create prefabs

①Create an object under the "Hierarchy" panel, rename it as "wall and adjust each parameter"
②Create a file "Prefabs" to store the prefab
③Drag the object under the file, if you need to use the same object, you can drag it directly out of prefab

insert image description here

insert image description here
insert image description hereinsert image description here

(4) Build interactive objects

According to the steps mentioned above, generate multiple identical objects through prefab or direct copy
insert image description here

2. Add physical components

(1) Collision detection

①Click "Add Component" at the bottom of the Hierarchy panel
②Search for "Sphere Collider" and click to add this component

insert image description here

(2) Add physical components

①Click "Add Component" at the bottom of the Hierarchy panel, search for "Rigidbody" steel components to add

Add rigid body component function: simulate physical effects (gravity, friction, elasticity, power, etc.), you can control the movement of the ball through the rigid bodyinsert image description here

Rendering model and collision model need to be separated

At the same time, the smaller the consumption of collision monitoring, the smoother the operation.
The model here is a set of fine modeling for rendering, and a set of low-poly collision monitoring for penetration.

Reduce die-through

Adjust camera position

3. Code components

Suggested Code Zero Foundation Students

Imitate without seeking deep understanding, and learn the basics of C# grammar in the later stage

(1) Add and delete code components

① Two ways to add:
a. In Project
> Assets, right-click to select create to create a C# script, and rename it to "New Name" and right-click to open
b. On the Inspector panel,
click "Add Component" at the bottom of the Inspector panel to add
components② There are two ways to delete:
a. Delete code
b. Delete components

(2) The basic structure of the script

 a、引用  
 b、脚本名字(类名)(类名和脚本名保持一致)  
 c、什么是方法  
 d、Start方法和Update方法 - 系统方法(事件方法)  

insert image description here

(3) Console panel - Console

 a、怎么打开—“Crtl+shift+C” 可以快速唤出可控制面板  
 b、怎么输出—  
 c、收缩输出—  
 d、注释——

(4) Obtain the rigid body component in the code

In the Player script
a, the first method - get
private Rigidbody rd;
rd = rd = GetComponent<Rigidbody>();
b by code, the second method - by dragging
public Rigidbody rd;

(5) Add force to the ball

 **a、小球的碰撞监测**——在player脚本里写一个系统事件
private void OnCollisionEnter(Collision collision)
    {
        Debug.Log("发生碰撞了 OnCollisionEnter");
        if(collision.gameObject.tag == "Food")
        {
            Destroy(collision.gameObject);
        }
    }

collision collision to detect and store the collision information
Add the label "Food"

(6) Let the object rotate

Add the "food" script to the prefab, each instance will have this script
transform. Rotate is
the rotation of vector3.up around itself


Summarize

Not yet completed

Digression

Many people who are new to the computer industry or graduates of computer-related majors have encountered obstacles everywhere due to lack of practical experience. Let's look at two sets of data:

  • The 2023 national college graduates are expected to reach 11.58 million, and the employment situation is severe;

  • According to the data released by the National Network Security Publicity Week, by 2027, the shortage of network security personnel in my country will reach 3.27 million.

On the one hand, the employment situation of fresh graduates is severe every year, and on the other hand, there is a gap of one million cyber security talents.

On June 9, the 2023 edition of the Employment Blue Book of MyCOS Research (including the 2023 Employment Report for Undergraduates in China and the Employment Report for Higher Vocational Students in China in 2023) was officially released.

Top 10 Majors with Higher Monthly Salary for 2022 College Graduates

The monthly income of undergraduate computer science majors and higher vocational automation majors is relatively high. The monthly income of the 2022 class of undergraduate computer science and higher vocational automation majors is 6,863 yuan and 5,339 yuan, respectively. Among them, the starting salary of undergraduate computer majors is basically the same as that of the 2021 class, and the monthly income of higher vocational automation majors has increased significantly. The 2022 class of overtaking railway transportation majors (5295 yuan) ranks first.

Specifically, depending on the major, the major with a higher monthly income for undergraduates in 2022 is information security (7579 yuan). Compared with the class of 2018, undergraduate majors related to artificial intelligence such as electronic science and technology, automation, etc. performed well, and their starting salaries increased by 19% compared with five years ago. Although data science and big data technology are new majors in recent years, they have performed well, and have ranked among the top three majors with higher monthly income half a year after graduation for the class of 2022 undergraduates. The only humanities and social science major that entered the top 10 undergraduate high-paying list five years ago-French has dropped out of the top 10.

"There is no national security without cybersecurity". At present, network security has been elevated to the height of national strategy and has become one of the most important factors affecting national security and social stability.

Characteristics of the network security industry

1. The employment salary is very high, and the salary rises quickly. In 2021, Liepin.com released the highest employment salary in the network security industry, which is 337,700 yuan per capita!

2. There is a large talent gap and many employment opportunities

On September 18, 2019, the official website of the "Central People's Government of the People's Republic of China" published: my country needs 1.4 million cyberspace security talents, but schools across the country train less than 1.5 million people each year. Liepin.com's "Cyber ​​Security Report for the First Half of 2021" predicts that the demand for cyber security talents will be 3 million in 2027, and there are only 100,000 employees currently engaged in the cyber security industry.

The industry has a lot of room for development and many jobs

Since the establishment of the network security industry, dozens of new network security industry positions have been added: network security experts, network security analysts, security consultants, network security engineers, security architects, security operation and maintenance engineers, penetration engineers, information security management Data Security Engineer, Network Security Operations Engineer, Network Security Emergency Response Engineer, Data Appraiser, Network Security Product Manager, Network Security Service Engineer, Network Security Trainer, Network Security Auditor, Threat Intelligence Analysis Engineer, Disaster Recovery Professional , Actual combat offensive and defensive professionals...

Great career potential

The network security major has strong technical characteristics, especially mastering the core network architecture and security technology in the work, which has an irreplaceable competitive advantage in career development.

With the continuous improvement of personal ability, the professional value of the work will also increase with the enrichment of one's own experience and the maturity of project operation, and the appreciation space is bullish all the way, which is the main reason why it is popular with everyone.

To some extent, in the field of network security, just like the doctor profession, the older you are, the more popular you become. Because the technology becomes more mature, the work will naturally be valued, and promotion and salary increase are a matter of course.

How to Learn Hacking & Cyber ​​Security

Today, as long as you give my article a thumbs-up, I will share my private collection of online security learning materials with you for free, so let’s see what is there.

1. Learning Roadmap

There are also many things to learn in attack and defense. I have written all the specific things to learn in the roadmap above. If you can learn them, you will have no problem getting a job or taking private jobs.

2. Video Tutorial

Although there are many learning resources on the Internet, they are basically incomplete. This is a video tutorial on cyber security recorded by myself. I have a supporting video explanation for every knowledge point in the above roadmap.

The content covers the study of network security law, network security operation and other guarantee assessment, penetration testing basics, detailed explanation of vulnerabilities, basic computer knowledge, etc., which are all learning contents that must be known when getting started with network security.

(It’s all packed into one piece and cannot be unfolded one by one. There are more than 300 episodes in total)

Due to limited space, only part of the information is shown, you need to click the link below to get it

CSDN spree: "Hacker & Network Security Introduction & Advanced Learning Resource Pack" free sharing

3. Technical documents and e-books

The technical documents are also compiled by myself, including my experience and technical points of participating in large-scale network security operations, CTF and SRC vulnerability mining. There are also more than 200 e-books. Due to the sensitivity of the content, I will not show them one by one.

Due to limited space, only part of the information is shown, you need to click the link below to get it

CSDN spree: "Hacker & Network Security Introduction & Advanced Learning Resource Pack" free sharing

4. Toolkit, interview questions and source code

"If you want to do a good job, you must first sharpen your tools." I have summarized dozens of the most popular hacking tools for everyone. The scope of coverage mainly focuses on information collection, Android hacking tools, automation tools, phishing, etc. Interested students should not miss it.

There is also the source code of the case and the corresponding toolkit mentioned in my video, which can be taken away if needed.

Due to limited space, only part of the information is shown, you need to click the link below to get it

CSDN spree: "Hacker & Network Security Introduction & Advanced Learning Resource Pack" free sharing

Finally, there are interview questions about Internet security that I have sorted out in the past few years. If you are looking for a job in Internet security, they will definitely help you a lot.

These questions are often encountered in interviews with Sangfor, Qi Anxin, Tencent or other major companies. If you have good questions or good insights, please share them.

Reference analysis: Sangfor official website, Qi Anxin official website, Freebuf, csdn, etc.

Content features: clear organization, including graphic representation, which is easier to understand.

Summary of content: Including intranet, operating system, protocol, penetration test, security service, vulnerability, injection, XSS, CSRF, SSRF, file upload, file download, file inclusion, XXE, logic vulnerability, tool, SQLmap, NMAP, BP, MSF…

Due to limited space, only part of the information is shown, you need to click the link below to get it

CSDN spree: "Hacker & Network Security Introduction & Advanced Learning Resource Pack" free sharing

Guess you like

Origin blog.csdn.net/Python_0011/article/details/131743734