当前位置:网站首页>[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
2022-07-06 10:18:00 【Two water first wood show】
Plug in links : link :https://pan.baidu.com/s/1ZvOnAvFSowBib3ZJ-ombdw
Extraction code :sen5
After importing the plug-in, go directly to Jelly Sprite Demo Scene scene
Core script description :
Body Configuration Determine the shape of the spring ,Num Colliders Number of springs ,Collider Radius Spring radius ,Collider Scale Spring size , Num Attach Points Number of bundled nodes , Attach Point Bundle nodes Eyes
The shader of the object where the script is located is dynamically generated , Shaders will default to Sprite/Defaults Shaders , Maps use UnityJellySprite Of Sprite Parameters ( The first parameter )
Material compatible processing :UnityJellySprite The main texture setting method of the script may be different from that of the old version, and there are also problems of space determination and error reporting, which are modified as follows .
If you need to use your own shader to render the elastic sphere, modify Shader.Find("Sprite/Default") Content is enough .
BlobBehaviour.cs Script description : It is a random time to add a Force The effect of , Let the sphere bounce .m_JellySprite.AddForce Interface to add force ( Note that it is not a rigid body component yes JellySprite(UnityJellySprite Parent script )
problem : How to know collision detection events ?
After running the game, you will find a pile of such objects
It has scripts to monitor physical collision events , And sent events to our objects
So just add event methods to the object script , When it collides with an object, it will send an event to trigger .
Because there are many spring colliders , And the name is the object name Ref Point n In the form of , So we can split the object name and take the first string To identify which sphere it collided with .
We can use these events to do something interesting , such as : A replica of synthetic watermelon .
边栏推荐
猜你喜欢
Redis集群方案应该怎么做?都有哪些方案?
Installation de la pagode et déploiement du projet flask
112 pages of mathematical knowledge sorting! Machine learning - a review of fundamentals of mathematics pptx
Security design verification of API interface: ticket, signature, timestamp
The programming ranking list came out in February. Is the result as you expected?
实现以form-data参数发送post请求
C miscellaneous shallow copy and deep copy
If someone asks you about the consistency of database cache, send this article directly to him
软件测试工程师必备之软技能:结构化思维
Control the operation of the test module through the panel in canoe (Advanced)
随机推荐
Compress decompress
Introduction tutorial of typescript (dark horse programmer of station B)
① BOKE
jar运行报错no main manifest attribute
高并发系统的限流方案研究,其实限流实现也不复杂
Routes and resources of AI
美新泽西州州长签署七项提高枪支安全的法案
Use xtrabackup for MySQL database physical backup
Several errors encountered when installing opencv
South China Technology stack cnn+bilstm+attention
C杂讲 双向循环链表
Tianmu MVC audit I
flask运维脚本(长时间运行)
[after reading the series of must know] one of how to realize app automation without programming (preparation)
Time complexity (see which sentence is executed the most times)
Download and installation of QT Creator
Jar runs with error no main manifest attribute
17 医疗挂号系统_【微信支付】
Docker MySQL solves time zone problems
Preliminary introduction to C miscellaneous lecture document