当前位置:网站首页>If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats

If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats

2022-07-05 16:38:00 InfoQ

About author

as everyone knows , Life is a long process , Constantly overcome difficulties , Constantly reflect on the process of progress . In this process, there will be a lot of questions and thoughts about life , So I decided to put my thinking , Share all your experiences and stories , To find resonance !!!
Focus on  Android/Unity  And various game development skills , And all kinds of resource sharing ( Website 、 Tools 、 material 、 Source code 、 Games etc. )

Premise

A sudden flash of light : Using a
The tailing of particles +DOTween  Realization
A cat .(GIF  It looks a little stuck , The card is not actually stuck )

null

Practice process

I will try my best to restore the whole process from zero to some ,  Instead of coming up, it's a well-designed step .

First we import  DOTween  plug-in unit :

null
Don't worry about... After importing , Create a particle , Coordinate for (28.1,22.6,0), Then set their properties as follows :

null
Mainly the duration and starting size , by the way , And speed , Because we'll use  DOTween  To control the movement of particles .

null
Above picture , The emission module sets the particles to  1, Shape module can actually do anything , As long as the size is  0  that will do , Because she needs to keep  1  A and static state .

Then find the trailing module , Check on , Check world space ( No choice, no effect ), The trailing width needs to be smaller , This can highlight the progress feeling of the ECG head .

null
We create a material ,Shader  by  Legacy Shaders/Particles/Additive.

Texture  Direct selection  Default-Particle  that will do .

Then we open the particle renderer module , First assign the material to the material and trailing material properties ( In order to be more perfect, we will change the material ).

Okay , We imported... Before  DOTween  plug-in unit , Now add... Under this particle object  DOTween Path  Script .

stay  DOTween Path  Below the script  Waypoints, Inside is the path point , Of course, you can also use shortcut keys to create and delete , It's just that this is a specific coordinate point , It's just easier to write .

Let's add a cat's path

null
null
So let's go on to create cat eyes and beards :

null
Let's run it , The effect is coming out .

Ha ha ha ,(>^ω^<) meow ~!  Belch ~!

other

author : Xiaokong and Xiaozhi
Xiaokong
Reprint note - Be sure to indicate the source :https://www.infoq.cn/profile/DB2492B85795C4/publish
This Taoist friend, please
Step back
️, I watch you
Extraordinary bearing
, There is a king's domineering spirit in his speech , There will be a great achievement in the future !!! There is
give the thumbs-up
Collection
Today I tell you , Have you ordered it , Your success in the future ️, I don't take a penny , If it doesn't work ️, Or come back to me .
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051556471086.html