当前位置:网站首页>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
边栏推荐
- How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
- An intern's journey to cnosdb
- Maxcompute string splitting function -split_ PART
- Wechat applet taro learning record
- C#课程设计之员工信息管理系统
- About Wireshark's unsuccessful installation of npcap
- 2020-12-12
- How to clear the console password for s7700 device
- [untitled]
- Mutual call between Lua and C #
猜你喜欢

数据库应用技术课程设计之商城管理系统

An intern's journey to cnosdb

Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products

Editor Extensions

C language - Introduction - essence Edition - take you into programming (I)

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

Scite change background color

Lua framwrok framework starts

Worldview satellite remote sensing image data / meter resolution remote sensing image

C语言-入门-精华版-带你走进编程(一)
随机推荐
C语言-入门-精华版-带你走进编程(一)
Huawei switch: configure Telnet, SSH and web access
the installer has encountered an unexpected error installing this package
Idea dereference display effect
超限黑客认知
My touch screen production "brief history" 1
Unity2019_ Natural ambient light_ Sky box
WorldView卫星遥感影像数据/米级分辨率遥感影像
P2704 [NOI2001] 炮兵阵地(状压dp)
STM32F103 SPI (pit Diary)
Technical dry goods | some thoughts on the future of AI architecture
haproxy+keepalived集群搭建02
How to establish rectangular coordinate system in space
Ventuz Foundation Series "one step at the door"
[at] ABC 258g - Triangle triples reachable - violence
About the problem that the editor and the white screen of the login interface cannot be found after the location of unityhub is changed
一个实习生的CnosDB之旅
About Wireshark's unsuccessful installation of npcap
MaxCompute字符串分割函数-SPLIT_PART
JS regular case-