当前位置:网站首页>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
边栏推荐
- 一个实习生的CnosDB之旅
- jsutlis
- P1896 [SCOI2005] 互不侵犯(状压dp)
- Technical dry goods Shengsi mindspire dynamic transformer with variable sequence length has been released!
- P2622 light off problem II (state compression search)
- Transfinite hacker cognition
- Client server model
- Multi traveling salesman problem -- overview of formula and solution process
- MaxCompute字符串分割函数-SPLIT_PART
- vcs import src < ros2. Repos failed
猜你喜欢
Unity change default editor
Abstract classes and interfaces
Wpf: solve the problem that materialdesign:dialoghost cannot be closed
[cocos creator] Click the button to switch the interface
Wechat applet taro learning record
How to configure GDAL under idea
数据的存储
Install cross compiler arm none liunx gnueabihf
Editor Extensions
Docker installs MySQL and successfully uses Navicat connection
随机推荐
什麼是定義?什麼是聲明?它們有何區別?
Oracle queries grouped by time
How to configure GDAL under idea
Basic operation and process control
Getting started with minicom
RM delete file
Install cross compiler arm none liunx gnueabihf
I want to do large screen data visualization application feature analysis
数据的存储
Yolo series --- xml2txt script
[global product discovery 2] the first pure cloud augmented reality (AR) platform - Israel
Huawei switch console password reset, device initialization, default password
the installer has encountered an unexpected error installing this package
About Wireshark's unsuccessful installation of npcap
使用 FileChannel 进行文件的复制拷贝
Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
Three characteristics
Haproxy+kept cluster setup 02
jsutlis
Docker installs MySQL and successfully uses Navicat connection