当前位置:网站首页>Unity beginner 5 cameras follow, border control and simple particle control (2 d)
Unity beginner 5 cameras follow, border control and simple particle control (2 d)
2022-07-30 04:29:00 【Lin Fusheng】
This article comes from the notes of teacher chutianbo, link b station
Camera
Don't ask, ask is brainless cinemachine (233, I only know this)
Click on the upper left corner of the window package manager to find the Unity Registry and directly find this plugin in the middle to download
After downloading, we are in HierachyRight-click to create and you can find this cinemachine.
Then directly follow the character you need to follow in Followjust
Camera Boundaries
After setting up, we will find that many of our voids will also come into view.
1. So we add the component Cinemachine Confiner2D to this CM vcm1 (that is, the camera created with cinemachine)
2. Create an empty GameObject and add the component polygon Collider 2D to it, and then pull the green frame to the requiredThe displayed map is the same.
3. Just pull the border into it
Particle Effects
1. Create right-click HierachyEffects particle System
About how to use emm for each button, the official link is given below
Here is a simple explosion effect
InitiallyOriginal material
1. Because it only takes a moment to hit the special effect,And the emitter should be a circle
2. So the time to explode the particle should be 0
3. At the same time no need to repeat
1. Then the first thing we do is to replace the particles, it can be seen that the particles we created at the beginning are white instead of the material we want, 
So find the Texture module and change the mode to sprite to replace the material
2. Set the shape and find the shape module
Change the shape to circle, if it is 3d, it is hemisphere.
Radius is the radius of the circle.
Radius Thickness: The volume ratio of emitted particles.A value of 0 emits particles from the edge of the circle.A value of 1 emits particles from the entire area.Values in between will use a percentage of the area.
Arc is the angle because it needs a circle and that is 360
In fact, I spent a lot of time doing this. In one, I changed the scale, which caused the circle to become a circle perpendicular to the interface. Generally speaking, 2d means that xy is 1.
3.Particle burst time
Find Emission to change Rate over TimeIt is 0, that is, it can explode in an instant
So far, our special effect is done, but one thing to mention is that if our special effect is placed on a moving object and needs to move with the object
We need to change the Simulation Space to World.
The effect is probably like this, the robot goes to the right, the smoke will be realEffect.
Code Control Effects
The example used here is the smoke effect of the robot above, which should be roughly the same
1. Expose particle effects properties
public ParticleSystem smoke;
2. Pull the finished effects into our public properties
(There is actually a bug here, that is, if we use this special effect as a child object of our robot first, then this special effect can only be accessed from under our child objectPull in, but not from our prefab, if it is pulled in from other places, then the code will be changed later)
3. Call in the function
//Choose one of two
smoke.Stop();
//
Destroy(smoke.gameObject);
If there is no error in the difference between these two functions, then the first is to let the particle life cycle end and then disappear, and the secondOne is to disappear directly, no matter how long the particle's life cycle is.
The Duration here is the life cycle
Linkunity official file: particle system
Materials used in this articleFrom unity store Ruby's adventure
linkunity official website
边栏推荐
- 山西省第二届网络安全技能大赛(企业组)部分赛题WP(九)
- What is the data directory?Why do you need it?
- MySQL data query (subtotal and sorting)
- Charles 替换 接口响应信息
- 05全局配置文件application.properties详解
- 共建共享数字世界的根:阿里云打造全面的云原生开源生态
- Many overseas authoritative media hotly discuss TRON: laying the foundation for the decentralization of the Internet
- [The Mystery of Cloud Native] Cloud Native Background && Definition && Detailed explanation of related technologies?
- High Concurrency Framework Disruptor
- Database Design of Commodity Management System--SQL Server
猜你喜欢
![[SQL] at a certain correlation with a table of data update another table](/img/66/4dff4383509e5d25890d8a24720de6.png)
[SQL] at a certain correlation with a table of data update another table

2.5快速排序

Hongji was once again shortlisted in the Gartner 2022 RPA Magic Quadrant and achieved a significant jump in position

【线性表】- LeetCode力扣三道练习题详解

Thinkphp 5.0.24 Variable Override Vulnerability Causes RCE Analysis

Atomic Guarantees of Redis Distributed Locks

@WebServlet注解(Servlet注解)

网页元素解析a标签

机器学习:知道通过低方差过滤实现降维过程

golang八股文整理(持续搬运)
随机推荐
2.6归并排序
cnpm安装步骤
Redis【超详解!!!】
Boss Rush (二分答案 + 状压DP)
JQ source code analysis (environment)
基于OpenCV实现的图像拼接(配准)案例
Go书籍大全-从初级到高级以及Web开发
Pytorch框架学习记录5——DataLoader的使用
LeetCode 114. Expand Binary Tree into Linked List (One Question Three Eats)
Data Lake: Data Integration Tool DataX
Thinkphp 5.0.24变量覆盖漏洞导致RCE分析
MySQL data query (subtotal and sorting)
A brief introduction to the SSM framework
Flink学习第一天——什么是批量、流式计算?
MySQL operation statement Daquan (detailed)
山西省第二届网络安全技能大赛(企业组)部分赛题WP(十)
【C语言】程序环境和预处理
宇宙的尽头是银行?聊聊在银行做软件测试的那些事
How to Effectively Conduct Retrospective Meetings (Part 1)?
海外多家权威媒体热议波场TRON:为互联网去中心化奠定基础