当前位置:网站首页>Get to know unity2 for the first time
Get to know unity2 for the first time
2022-07-03 08:06:00 【Luckyᕙ(⇀‸↼‵‵)ᕗ】
1.4、 Layered design of project engineering
Sceces: Save the scene
Scripts: Store scripts
Resources: Resource Pack
Textures: Mapping
Materials: texture of material ( Mainly for .mat file )
Audios: voice
Models: Model ( Deposit FBX Wait for the documents )
Prefabs: Presupposition
Effects: Special effects
Plugins: plug-in unit
1.5、 Mapping 、 Shaders and presets
1.5.1 Concept
texture of material (Material): The texture of an object , What does the object look like
1.5.2 Create and use shaders
1、 stay Assets To establish “Textures” Folder , For storing maps ( For the convenience of management )

2、 Use shaders : Directly drag the picture onto the cube ( Automatically generate a shader )

1.5.3 Presupposition
hold Cube Drag onto Assets Under the folder , A preset body is automatically created

You can use this preset as a template , Dragging into the scene can be used directly

1.6、 Variables and VS Editor
1.6.1、 Variable
public int id; // You can see in the property panel
public The value of the decorated variable , Subject to the of the property panel
private string name; // You can't see it in the property panel
protected string sex; // You can't see it in the property panel
int age; // You can't see it in the property panel
Debugging information
Debug.Log(id);
print(name);
1.6.2、 change VS Editor
Edit-->preferences-->Extemal Tools-->Extemel Script Editor-->D:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE-->devenv.exe--> close
1.7、 Common functions
1、Awake(): Wake up script , This method is the first method of system execution , Initialization for scripts , In script Only once in the life cycle of .
2、Update(): Normal update , Used to update logic . Every time you create a script , This will be added by default in the script Method . This method Every time frame Will be automatically called by the system once .
3、Start(): In this method Awake() After method ,Update() Method is executed before , And only once
4、LateUpdate(): In this method Update() Call after execution of method , Also called every frame .
5、FixedUpdate(): Fixed update , Update frequency is 0.02s

Case test :
publicclass LifeCycle : MonoBehaviour {
void Awake()
{
print ("Awake...");
}
void OnEnable()
{
print ("OnEnable...");
}
void Start()
{
print ("Start...");
}
void Update()
{
print ("Update...");
}
void FixedUpdate()
{
print ("FixedUpdate...");
}
void LateUpdate()
{
print ("LateUpdate...");
}
void OnGUI()
{
print ("OnGUI...");
}
void OnDisable()
{
print ("OnDisable...");
}
void OnDestroy()
{
print ("OnDestroy...");
}
}
Script life cycle
边栏推荐
- A tunnel to all ports of the server
- Luaframwrok handles resource updates
- I want to do large screen data visualization application feature analysis
- Iterm2 setting
- oracle 插入单引号
- Technical dry goods | some thoughts on the future of AI architecture
- Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
- P2704 [noi2001] artillery position (shape pressure DP)
- Wpf: solve the problem that materialdesign:dialoghost cannot be closed
- Lua hot update basic grammar
猜你喜欢

An article for you to understand - Manchester code

WorldView卫星遥感影像数据/米级分辨率遥感影像

WPF:解决MaterialDesign:DialogHost 无法关闭问题

CLion-Toolchains are not configured Configure Disable profile问题解决

多旅行商问题——公式和求解过程概述

C language learning notes (mind map)

Transplantation of freetype Library

Oracle queries grouped by time
![[MySQL 14] use dbeaver tool to remotely backup and restore MySQL database (Linux Environment)](/img/38/3435d353e50b19fe09c8ab9db52204.png)
[MySQL 14] use dbeaver tool to remotely backup and restore MySQL database (Linux Environment)

Three characteristics
随机推荐
VMware virtual machine configuration static IP
Scite change background color
IP production stream is so close to me
Pulitzer Prize in the field of information graphics - malofiej Award
idea取消引用显示效果
使用 FileChannel 进行文件的复制拷贝
L'installateur a été installé avec une erreur inattendue
Redis batch startup and shutdown script
Clip Related Script
Demonstration of plug-in use of ventuz basic series
Multi traveling salesman problem -- overview of formula and solution process
Storage of data
PIP uses image website to solve the problem of slow network speed
Idea dereference display effect
My touch screen production "brief history" 1
Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
STM32F103 SPI (pit Diary)
什么是数据类型?数据类型有什么用?
Redis view client connection
Huawei switch basic configuration (telnet/ssh login)