《UnityAPI.ParticleSystem粒子系统》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Particle+loop+Emit+立钻哥哥++OK++)
《UnityAPI.ParticleSystem粒子系统》
版本 |
作者 |
参与者 |
完成日期 |
备注 |
UnityAPI_ParticleSystem_V01_1.0 |
严立钻 |
|
2020.05.25 |
|
|
|
|
|
|
#《UnityAPI.ParticleSystem粒子系统》发布说明:
++++“UnityAPI.ParticleSystem粒子系统”是对UnityAPI中ParticleSystem类的剖析和拓展;
立钻哥哥:Unity是一个入门快、提高难的游戏引擎,想要提升能力,至少需要越过3道坎:API+Shader+综合能力;++1、API的积累:对API的合理利用不仅可以减轻自己的编码负担,而且往往可以提高程序的运行效率;这也是钻哥开始“Unity API”独立打造分类的初衷; ++2、Shader编程:想要做出一款精品游戏往往需要有高效的Shader的支持;Unity提供了一套改良的“Shader Lab”系统,优化了繁杂的“Open GL”编程; ++3、综合能力(技术+业务+管理):一款产品的制作除了功能编程外,往往会涉及很多其他领域,例如产品架构、UI交互设计、模型制作等,作为主要的编程人员,对其他相关领域的了解程序往往会影响到产品制作直至最后的产品体验; ++++立钻哥哥一直在推动【VR云游戏=Unity+SteamVR+云技术+5G+AI】,这个只是一个引子,抛砖引玉让大家对整个知识体系有一个明确的落地方向,宝宝们可以根据自己的兴趣方向进行拓展:比如Unity这里是指一种“3D游戏引擎”,也可拓展至“UE4、Cocos2dx”等游戏引擎;SteamVR是一种跨硬件解决方案,也可拓展至“VRTK”等第三方插件;“云技术+5G”是一种跨平台解决方案的核心技术,同样可拓展至其他平台解决方案;AI也是一种先进技术的举例,也可以拓展至任何一种前沿技术; |
@@提示:有些博客可能只是开了头,如果感兴趣的同学,可以“点赞”或“评论区留言”,只要关注的同学多了,那就会继续完善哟!(“++==”,表示没有写完的,如果关注度不高就不完善了;“++ok++”,表示此篇博客已经完成,是阶段性完整的!)
$$$$博客溯源:
++++VR云游戏=Unity+SteamVR+云技术+5G+AI;(说明:AI人工智能不是我们的主要研究技术,只是了解一下,领略一下有风的感觉!但是,VR是我们的研究重点)
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html
++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html
++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html
++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html
++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/
#ParticleSystem粒子系统
#ParticleSystem粒子系统 |
#ParticleSystem粒子系统++A1、Description描述++B2、Variables变量++C3、Public Function共有函数++D4、Message消息 |
#A1、Description描述
#A1、Description描述 |
++A1、Description描述
++++立钻哥哥:ParticleSystem(粒子系统)是Unity粒子系统的脚本接口;
++++[namespace]:UnityEngine;
++++[Inherits from]:Component;
++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++[Unity快速入门]:https://blog.csdn.net/VRunSoftYanlz/article/details/105776475
++++[UnityAPI目录]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533906
++++[Application应用]:https://blog.csdn.net/VRunSoftYanlz/article/details/106086327
++++[Object对象]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194
++++[GameObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106223815
++++[MonoBehaviour]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533256
++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004
++++[Camera摄像机]:https://blog.csdn.net/VRunSoftYanlz/article/details/106148837
++++[Shader着色器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106321040
++++[Material材质]:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303
++++[Physics物理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106268062
++++[RaycastHit]:https://blog.csdn.net/VRunSoftYanlz/article/details/106292370
++++[ParticleSystem]:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995
++++[WWW万维网]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412890
++++[LineRenerer]:https://blog.csdn.net/VRunSoftYanlz/article/details/106306388
++++[WheelCollider]:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217
++++[MovieTexture]:https://blog.csdn.net/VRunSoftYanlz/article/details/106434063
#B2、Variables变量
#B2、 Variables变量 |
++B2、Variables变量++++B2.1、collision++++B2.2、colorBySpeed++++B2.3、colorOverLifetime++++B2.4、duration++++B2.5、emission++++B2.6、externalForces++++B2.7、forceOverLifetime++++B2.8、gravityModifier++++B2.9、inheritVelocity++++B2.10、isPaused++++B2.11、isPlaying++++B2.12、isStopped++++B2.13、limitVelocityOverLifetime++++B2.14、loop++++B2.15、maxParticles++++B2.16、particleCount++++B2.17、playbackSpeed++++B2.18、playOnAwake++++B2.19、randomSeed++++B2.20、rotationBySpeed++++B2.21、rotationOverLifetime++++B2.22、scalingMode++++B2.23、shape++++B2.24、simulationSpace++++B2.25、sizeBySpeed++++B2.26、sizeOverLifetime++++B2.27、startColor++++B2.28、startDelay++++B2.29、startLifetime++++B2.30、startRotation++++B2.31、startRotation3D++++B2.32、startSize++++B2.33、startSpeed++++B2.34、subEmitters++++B2.35、textureSheetAnimation++++B2.36、time++++B2.37、velocityOverLifetime++++B2.38、YanlzXREngine.ParticleSystem.Variables |
++B2.1、collision
++B2.1、collision |
++B2.1、collision
++++立钻哥哥:碰撞信息;
public ParticleSystem.CollisionModule collision; |
++++访问粒子系统的碰撞模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var coll = ps.collision; coll.enabled = true; coll.bounce = new ParticleSystem.MinMaxCurve(0.5f); } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.2、colorBySpeed
++B2.2、colorBySpeed |
++B2.2、colorBySpeed
++++立钻哥哥:颜色速度;
public ParticleSystem.ColorBySpeedModule colorBySpeed; |
++++访问粒子系统的颜色生命周期;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
//var col = ps.colorOverLifetime; //立钻哥哥:颜色生命周期 var col = ps.colorBySpeed; col.enabled = true;
Gradient grad = new Gradient(); grad.SetKeys( new GradientColorKey[]{ new GradientColorKey(Color.bule, 0.0f), new GradientColorKey(Color.red, 1.0f)}, new GradientAlphaKey[]{ new GradientAlphaKey(1.0f, 0.0f), new GradientAlphaKey(0.0f, 1.0f)} );
col.color = new ParticleSystem.MinMaxGradient(grad);
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.3、colorOverLifetime
++B2.3、colorOverLifetime |
++B2.3、colorOverLifetime
++++立钻哥哥:颜色生命周期;
public ParticleSystem.ColorOverLifetimeModule colorOverLifetime; |
++++访问粒子系统的颜色生命周期模块;
++B2.4、duration
++B2.4、duration |
++B2.4、duration
++++立钻哥哥:持续时间;
public float duration; |
++++粒子的持续时间,单位秒(只读);
++B2.5、emission
++B2.5、emission |
++B2.5、emission
++++立钻哥哥:发射;
public ParticleSystem.EmissionModule emission; |
++++访问粒子系统的发射模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystm : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var em = ps.emission; em.enabled = true; em.type = ParticleSystemEmissionType.Time; em.SetBursts(new ParticleSystem.Burst[]{ new ParticleSystem.Burst(2.0f, 100), new ParticleSystem.Burst(4.0f, 100) });
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.1f); curve.AddKey(0.75f, 1.0f);
em.rate = new ParticleSystem.MinMaxCurve(10.0f, curve);
} //立钻哥哥:void Start(){}
} //立钻哥哥:pbulic class YanlzParticleSystem{} |
++B2.6、externalForces
++B2.6、externalForces |
++B2.6、externalForces
++++立钻哥哥:外力;
public ParticleSystem.ExternalForcesModule externalForces; |
++++访问粒子系统的外力模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var ex = ps.externalForces; ex.enabled = true; ex.multiplier = 0.1f; } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.7、forceOverLifetime
++B2.7、forceOverLifetime |
++B2.7、forceOverLifetime
++++立钻哥哥:力的生命周期;
public ParticleSystem.ForceOverLifetimeModule forceOverLifetime; |
++++访问粒子系统的力的生命周期模块;
using UnityEngine using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>(); var fo = ps.forceOverLifetime; fo.enabled = true;
AnimationCurve cure = new AnimationCurve(); curve.AddKey(0.0f, 0.1f); curve.AddKey(0.75f, 1.0f);
fo.x = new ParticleSystem.MinMaxCurve(1.5f, curve); } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.8、gravityModifier
++B2.8、gravityModifier |
++B2.8、gravityModifier
++++立钻哥哥:重力修改器;
public float gravityModifier; |
++++应用到Physics.gravity所定义的重力的大小;
++B2.9、inheritVelocity
++B2.9、inheritVelocity |
++B2.9、inheritVelocity
++++立钻哥哥:继承速度;
public ParticleSystem.InheritVelocityModule inheritVelocity; |
++++访问粒子系统的速度继承模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var iv = ps.inheritVelocity; iv.enabled = true;
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 1.0f); curve.AddKey(1.0f, 0.0f); iv.curve = new ParticleSystem.MinMaxCurve(1.0f, curve); } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.10、isPaused
++B2.10、isPaused |
++B2.10、isPaused
++++立钻哥哥:是否暂停;
public bool isPaused; |
++++粒子系统现在暂停吗?
++B2.11、isPlaying
++B2.11、isPlaying |
++B2.11、isPlaying
++++立钻哥哥:是否正播放;
public bool isPlaying; |
++++粒子系统是否正播放?
++B2.12、isStopped
++B2.12、isStopped |
++B2.12、isStopped
++++立钻哥哥:是否已停止;
public bool isStopped; |
++++粒子系统是否已停止?
++B2.13、limitVelocityOverLifetime
++B2.13、limitVelocityOverLifetime |
++B2.13、limitVelocityOverLifetime
++++立钻哥哥:限制速度生命周期;
public ParticleSystem.LimitVelocityOverLifetimeModule limitVelocityOverLifetime; |
++++访问粒子系统的限制速度生命周期模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var lv = ps.limitVelocityOverLifetime; lv.enabled = true; lv.dampen = 0.5f;
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 1.0f); curve.AddKey(1.0f, 0.0f);
lv.limit = new ParticleSystem.MinMaxCurve(10.0f, curve);
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.14、loop
++B2.14、loop |
++B2.14、loop
++++立钻哥哥:循环;
public bool loop; |
++++粒子系统正循环?
++++如果在粒子系统播放时禁用循环,这将在当前循环结束之后停止;
++B2.15、maxParticles
++B2.15、maxParticles |
++B2.15、maxParticles
++++立钻哥哥:最大粒子数;
public int maxParticles; |
++++粒子发射的最大数量;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{ public float hSliderValue = 0.0F; public ParticleSystem part;
void Start(){ part = GetComponent<ParticleSystem>(); } //立钻哥哥:void Start(){}
void Update(){ part.maxParticles = Mathf.RoundToInt(hSliderValue); } //立钻哥哥:void Update(){}
void OnGUI(){ hSliderValue = GUI.HorizontalSlider(new Rect(25, 25, 100, 30), hSliderValue, 0.0F, 100.0F); } //立钻哥哥:void OnGUI(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.16、particleCount
++B2.16、particleCount |
++B2.16、particleCount
++++立钻哥哥:粒子数;
public int particleCount; |
++++粒子当前的数量(只读);
++B2.17、playbackSpeed
++B2.17、playbackSpeed |
++B2.17、playbackSpeed
++++立钻哥哥:播放速度;
public float playbackSpeed; |
++++粒子系统的播放速度;1是正常播放速度;
++++不支持负的播放速度;
++B2.18、playOnAwake
++B2.18、playOnAwake |
++B2.18、playOnAwake
++++立钻哥哥:唤醒时播放;
public bool playOnAwake; |
++++如果设置为true,该粒子系统将在启动的时候自动开始播放;
++++注意:唤醒播放在当前粒子效果下的所有粒子是共享设置;
++B2.19、randomSeed
++B2.19、randomSeed |
++B2.19、randomSeed
++++立钻哥哥:随机种子;
public uint randomSeed; |
++++随机种子用于粒子系统发射;如果设置为0,将在唤醒时分配随机值;
++B2.20、rotationBySpeed
++B2.20、rotationBySpeed |
++B2.20、rotationBySpeed
++++立钻哥哥:旋转速度;
public ParticleSystem.RatationBySpeedModule rotationBySpeed; |
++++访问粒子系统的旋转速度模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>(); var rot = ps.rotationBySpeed; rot.enabled = true;
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.1f); curve.AddKey(0.75f, 0.6f);
AnimationCurve curve2 = new AnimationCurve(); curve2.AddKey(0.0f, 0.2f); curve2.AddKey(0.5f, 0.9f);
rot.z = new ParticleSystem.MinMaxCurve(2.0f, curve, curve2); } //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.21、rotationOverLifetime
++B2.21、rotationOverLifetime |
++B2.21、rotationOverLifetime
++++立钻哥哥:旋转生命周期;
public ParticleSystem.RotationOverLifetimeModule rotationOverLifetime; |
++++访问粒子系统的旋转生命周期模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
//var rot = ps.rotationBySpeed; var rot = ps.rotationOverLifetime;
rot.enabled = true;
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.1f); curve.AddKey(0.75f, 0.6f);
AnimationCurve curve2 = new AnimationCurve(); curve2.AddKey(0.0f, 0.2f); curve2.AddKey(0.5f, 0.9f);
//rot.z = new ParticleSystem.MinMaxCurve(2.0f, curve, curve2); rot.angularVelocity = new ParticleSystem.MinMaxCurve(2.0f, curve, curve2);
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.22、scalingMode
++B2.22、scalingMode |
++B2.22、scalingMode
++++立钻哥哥:缩放模式;
public ParticleSystemScalingMode scalingMode; |
++++应用给粒子大小和位置的缩放模式;
++B2.23、shape
++B2.23、shape |
++B2.23、shape
++++立钻哥哥:图形;
public ParticleSystem.ShapeModule shape; |
++++访问粒子系统的图形模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var sh = ps.shape; sh.enabled = true; sh.shapeType = ParticleSystemShapeType.Mesh; sh.mesh = myMesh;
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.24、simulationSpace
++B2.24、simulationSpace |
++B2.24、simulationSpace
++++立钻哥哥:模拟空间;
public ParticleSystemSimulationSpace simulationSpace; |
++++选择哪个空间模拟粒子;可以是世界坐标空间或局部坐标空间;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{ public ParticleSystem part; public bool useLocal = true;
void Start(){ part = GetComponent<ParticleSystem>(); useLocal = part.simulationSpace == ParticleSystemSimulationSpace.Local; } //立钻哥哥:void Start(){}
void Update(){ part.simulationSpace = ((useLocal) ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World) } //立钻哥哥:void Update(){}
void OnGUI(){ useLocal = GUI.Toggle(new Rect(10, 60, 200, 30), useLocal, “Use Local Simulation Space.”); } //立钻哥哥:void OnGUI(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.25、sizeBySpeed
++B2.25、sizeBySpeed |
++B2.25、sizeBySpeed
++++立钻哥哥:大小速度;
public ParticleSystem.SizeBySpeedModule sizeBySpeed; |
++++访问粒子系统大小速度模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var ss = ps.sizeBySpeed; ss.enabled = true; ss.range = new Vector2(0.0f, 2.0f);
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.1f); curve.AddKey(0.75f, 1.0f);
ss.size = new ParticleSystem.MinMaxCurve(10.0f, curve);
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.26、sizeOverLifetime
++B2.26、sizeOverLifetime |
++B2.26、sizeOverLifetime
++++立钻哥哥:大小寿命周期;
public ParticleSystem.SizeOverLifetimeModule sizeOverLifetime; |
++++访问粒子系统的大小寿命周期模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var sz = ps.sizeOverLifetime; sz.enabled = true;
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 0.1f); curve.AddKey(0.75f, 1.0f);
sz.size = new ParticleSystem.MinMaxCurve(1.5f, curve);
} //立钻哥哥:voi Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.27、startColor
++B2.27、startColor |
++B2.27、startColor
++++立钻哥哥:开始颜色;
public Color startColor; |
++++当发射时粒子系统的初始颜色;
++B2.28、startDelay
++B2.28、startDelay |
++B2.28、startDelay
++++立钻哥哥:开始延迟;
public float startDelay; |
++++开始时延迟多少秒;
++++当系统启动时延迟多少秒开始播放;
++B2.29、startLifetime
++B2.29、startLifetime |
++B2.29、startLifetime
++++立钻哥哥:开始生命周期;
public float startLifetime; |
++++当粒子发射时,粒子总的生命周期,单位秒;当使用曲线,该值作为曲线上的大小;当粒子系统创建,该值在粒子上设置;
++B2.30、startRotation
++B2.30、startRotation |
++B2.30、startRotation
++++立钻哥哥:开始旋转角度;
public float startRotation; |
++++当粒子发射时,粒子的初始旋转角度;当使用曲线,该值作为曲线上的大小;
++++注意:该值是弧度;
++B2.31、startRotation3D
++B2.31、startRotation3D |
++B2.31、startRotation3D
++++立钻哥哥:开始旋转角度3D;
public Vector3 startRotation3D; |
++++当粒子发射时,粒子的初始3D旋转角度;当使用曲线,该值作为曲线上的大小;
++++注意:该值是弧度;
++B2.32、startSize
++B2.32、startSize |
++B2.32、startSize
++++立钻哥哥:开始大小;
public float startSize; |
++++当发射时,粒子的初始大小;当使用曲线,该值作为曲线上的大小;
++B2.33、startSpeed
++B2.33、startSpeed |
++B2.33、startSpeed
++++立钻哥哥:开始速度;
public float startSpeed; |
++++当发射时,粒子的初始速度;当使用曲线,该值作为曲线上的大小;
++B2.34、subEmitters
++B2.34、subEmitters |
++B2.34、subEmitters
++++立钻哥哥:子发射器;
public ParticleSystem.SubEmittersModule subEmitters; |
++++访问粒子系统的子发射器模块;
++B2.35、textureSheetAnimation
++B2.35、textureSheetAnimation |
++B2.35、textureSheetAnimation
++++立钻哥哥:纹理格动画;
public ParticleSystem.TextureSheetAnimationModule textureSheetAnimation; |
++++访问粒子系统的纹理格动画模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var ts = ps.textureSheetAnimation; ts.enabled = true; ts.numTilesX = 2; ts.useRandomRow = true;
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
++B2.36、time
++B2.36、time |
++B2.36、time
++++立钻哥哥:时间;
public float time; |
++++播放时间位置,单位秒;
++++使用这个读取当前播放时间或寻求新的播放时间;
++B2.37、velocityOverLifetime
++B2.37、velocityOverLifetime |
++B2.37、velocityOverLifetime
++++立钻哥哥:速度生命周期;
public ParticleSystem.VelocityOverLifetimeModule velocityOverLifetime; |
++++访问粒子系统的速度生命周期模块;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzParticleSystem : MonoBehaviour{
void Start(){ ParticleSystem ps = GetComponent<ParticleSystem>();
var vel = ps.velocityOverLifetime; vel.enabled = true; vel.space = ParticleSystemSimulationSpace.Local;
AnimationCurve curve = new AnimationCurve(); curve.AddKey(0.0f, 1.0f); curve.AddKey(1.0f, 0.0f);
vel.x = new ParticleSystem.MinMaxCurve(10.0f, curve);
} //立钻哥哥:void Start(){}
} //立钻哥哥:public class YanlzParticleSystem{} |
#C3、Public Functions公有函数
#C3、Public Functions公有函数 |
++C3、Public Functions公有函数++++C3.1、Clear++++C3.2、Emit++++C3.3、GetParticles++++C3.4、IsAlive++++C3.5、Pause++++C3.6、Play++++C3.7、SetParticles++++C3.8、Simulate++++C3.9、Stop++++C3.10、YanlzXREngine.ParticleSystem.PublicFunctions |
++C3.1、Clear
++C3.1、Clear |
++C3.1、Clear
++++立钻哥哥:清除;
public void Clear(bool withChildren=true); |
++++[withChildren]:清空所有子粒子系统;
++++删除粒子系统的所有粒子;
++C3.2、Emit
++C3.2、Emit |
++C3.2、Emit
++++立钻哥哥:发射;
public void Emit(int count);public void Emit(ParticleSystem.EmitParams emitParams, int count); |
++++[count]:要发射的粒子数;
++++[emitParams]:覆盖粒子属性;
++++立即发射count数量的粒子;
++++从脚本发射粒子的数量;
++++在emitParams设置顺序将覆盖已发射粒子的属性;未修改任何属性将继承在检视面板中的设置;
++C3.3、GetParticles
++C3.3、GetParticles |
++C3.3、GetParticles
++++立钻哥哥:获取粒子;
public int GetParticles(Particle[] particles); |
++++[particles]:用来写入粒子状态的粒子缓存器,返回值是已写入该数组的粒子数量;
++++返回粒子数组的粒子数量(当前活着的粒子数量);
++++获取粒子系统的粒子;
++++这个方法是获取输入参数particles数组一次性预先分配的长度;注意:当调用GetParticles()时,数组可能只是一小部分,取决于当前活着的粒子;
using UnityEngine; using YanlzXREngine;
[RequireComponent(typeof(ParticleSystem))] public class YanlzParticleFlow : MonoBehaviour{ ParticleSystem m_System; ParticleSystem.Particle[] m_Particles; public float m_Drift = 0.01f;
private void LateUpdate(){ MyInitializeIfNeeded();
//GetParticles is allocation free because we resuse the m_Particles buffer between updates int numParticlesAlive = m_System.GetParticles(m_Particles);
//Change only the particles that are alive for(int i = 0; i < numParticlesAlive; i++){ m_Particles[i].velocity += Vector3.up * m_Drift; }
//Apply the particle change to the particle system m_System.SetParticles(m_Particles, numParticlesAlive);
} //立钻哥哥:private void LateUpdate(){}
void MyInitializeIfNeeded(){ if(m_System == null){ m_System = GetComponent<ParticleSystem>(); }
if(m_Particles == null || m_Particles.Length < m_System.maxParticles){ m_Particles = new ParticleSystem.Particle[m_System.maxParticles]; }
} //立钻哥哥:void MyInitializeIfNeeded(){}
} //立钻哥哥:public class YanlzParticleFlow{} |
++C3.4、IsAlive
++C3.4、IsAlive |
++C3.4、IsAlive
++++立钻哥哥:是否活着;
public bool IsAlive(bool withChildren=true); |
++++[withChildren]:检测所有子粒子系统;
++++返回布尔值,如果粒子系统仍“活着”,返回true;如果粒子系统发射完所有粒子并所有粒子已经死亡,返回false;
++++该粒子系统还有任何活着的粒子?
立钻哥哥:Does the system have any live particles (or will produce more)? |
++C3.5、Pause
++C3.5、Pause |
++C3.5、Pause
++++立钻哥哥:暂停;
public void Pause(bool withChildren=true); |
++++[withChildren]:暂停所有子粒子系统;
++++暂停正播放的粒子系统;
++C3.6、Play
++C3.6、Play |
++C3.6、Play
++++立钻哥哥:播放;
public void Play(bool withChildren=true); |
++++[withChildren]:播放所有子粒子系统;
++++播放粒子系统;
++C3.7、SetParticles
++C3.7、SetParticles |
++C3.7、SetParticles
++++立钻哥哥:设置粒子;
public void SetParticles(Particle[] particles, int size); |
++++设置该粒子系统的粒子;size是设置粒子的数量;
++++设置粒子的生命周期为负值将导致Shuriken删除粒子;
++C3.8、Simulate
++C3.8、Simulate |
++C3.8、Simulate
++++立钻哥哥:模拟;
public void Simulate(float t, bool withChildren=true, bool restart=true); |
++++[t]:该粒子系统的快进时间;
++++[withChildren]:快进所有粒子系统;
++++[restart]:重新开始;
++C3.9、Stop
++C3.9、Stop |
++C3.9、Stop
++++立钻哥哥:停止;
public void Stop(bool withChildren=true); |
++++[withChildren]:停止所有子粒子系统;
++++停止播放粒子系统;
#D4、立钻哥哥对ParticleSystem粒子系统的拓展
#D4、立钻哥哥对ParticleSystem粒子系统的拓展 |
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++[Unity快速入门]:https://blog.csdn.net/VRunSoftYanlz/article/details/105776475
++++[UnityAPI目录]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533906
++++[Application应用]:https://blog.csdn.net/VRunSoftYanlz/article/details/106086327
++++[Object对象]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194
++++[GameObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106223815
++++[MonoBehaviour]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533256
++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004
++++[Camera摄像机]:https://blog.csdn.net/VRunSoftYanlz/article/details/106148837
++++[Shader着色器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106321040
++++[Material材质]:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303
++++[Physics物理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106268062
++++[RaycastHit]:https://blog.csdn.net/VRunSoftYanlz/article/details/106292370
++++[ParticleSystem]:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995
++++[WWW万维网]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412890
++++[LineRenerer]:https://blog.csdn.net/VRunSoftYanlz/article/details/106306388
++++[WheelCollider]:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217
++++[MovieTexture]:https://blog.csdn.net/VRunSoftYanlz/article/details/106434063
++++[Matrix4x4矩阵]:https://blog.csdn.net/VRunSoftYanlz/article/details/106504027
++++[Renerer渲染器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106481994
++++[AudioSource]:https://blog.csdn.net/VRunSoftYanlz/article/details/106462679
++++[AudioClip]:https://blog.csdn.net/VRunSoftYanlz/article/details/106448955
++++[Texture纹理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106448589
++++[AssetBundle]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412190
++++[ScriptableObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106392769
@@提示:有些博客可能只是开了头,如果感兴趣的同学,可以“点赞”或“评论区留言”,只要关注的同学多了,那就会继续完善哟!(“++==”,表示没有写完的,如果关注度不高就不完善了;“++ok++”,表示此篇博客已经完成,是阶段性完整的!)
++++VR云游戏=Unity+SteamVR+云技术+5G+AI;(说明:AI人工智能不是我们的主要研究技术,只是了解一下,领略一下有风的感觉!但是,VR是我们的研究重点)
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html
++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html
++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html
++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html
++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/
【XR游戏开发QQ群:784477094】
++立钻哥哥推荐的拓展学习链接(Link_Url):
立钻哥哥推荐的拓展学习链接(Link_Url) |
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/
++++虚拟现实VR资讯: https://blog.csdn.net/VRunSoftYanlz/article/details/89165846
++++HTC_VIVE开发基础:https://blog.csdn.net/VRunSoftYanlz/article/details/81989970
++++Oculus杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82469850
++++Oculus安装使用:https://blog.csdn.net/VRunSoftYanlz/article/details/82718982
++++Unity+SteamVR=>VR:https://blog.csdn.net/VRunSoftYanlz/article/details/88809370
++++Unity减少VR晕眩症:https://blog.csdn.net/VRunSoftYanlz/article/details/89115518
++++SteamVR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86484254
++++SteamVR脚本功能分析:https://blog.csdn.net/VRunSoftYanlz/article/details/86531480
++++SteamVR2.0开发指南:https://blog.csdn.net/VRunSoftYanlz/article/details/86618187
++++SteamVR2.2.0开发指南:https://blog.csdn.net/VRunSoftYanlz/article/details/88784527
++++SteamVR2.2.0快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/88833579
++++SteamVR2.2.0交互系统:https://blog.csdn.net/VRunSoftYanlz/article/details/89199778
++++SteamVR2.2.0传送机制:https://blog.csdn.net/VRunSoftYanlz/article/details/89390866
++++SteamVR2.2.0教程(一):https://blog.csdn.net/VRunSoftYanlz/article/details/89324067
++++SteamVR2.2.0教程(二):https://blog.csdn.net/VRunSoftYanlz/article/details/89894097
++++SteamVR_Skeleton_Poser:https://blog.csdn.net/VRunSoftYanlz/article/details/89931725
++++SteamVR实战之PMCore:https://blog.csdn.net/VRunSoftYanlz/article/details/89463658
++++SteamVR/Extras:https://blog.csdn.net/VRunSoftYanlz/article/details/86584108
++++SteamVR/Input:https://blog.csdn.net/VRunSoftYanlz/article/details/86601950
++++OpenXR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/85726365
++++VRTK杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82562993
++++VRTK快速入门(杂谈):https://blog.csdn.net/VRunSoftYanlz/article/details/82955267
++++VRTK官方示例(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82955410
++++VRTK代码结构(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82780085
++++VRTK(SceneResources):https://blog.csdn.net/VRunSoftYanlz/article/details/82795400
++++VRTK_ControllerEvents:https://blog.csdn.net/VRunSoftYanlz/article/details/83099512
++++VRTK_InteractTouch:https://blog.csdn.net/VRunSoftYanlz/article/details/83120220
++++虚拟现实行业应用:https://blog.csdn.net/VRunSoftYanlz/article/details/88360157
++++Steam平台上的VR:https://blog.csdn.net/VRunSoftYanlz/article/details/88960085
++++Steam平台热销VR:https://blog.csdn.net/VRunSoftYanlz/article/details/89007741
++++VR实验:以太网帧的构成:https://blog.csdn.net/VRunSoftYanlz/article/details/82598140
++++实验四:存储器扩展实验:https://blog.csdn.net/VRunSoftYanlz/article/details/87834434
++++FrameVR示例V0913:https://blog.csdn.net/VRunSoftYanlz/article/details/82808498
++++FrameVR示例V1003:https://blog.csdn.net/VRunSoftYanlz/article/details/83066516
++++SwitchMachineV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++PlaySceneManagerV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++Unity5.x用户手册:https://blog.csdn.net/VRunSoftYanlz/article/details/81712741
++++Unity面试题ABC:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++Unity面试题D:https://blog.csdn.net/VRunSoftYanlz/article/details/78630838
++++Unity面试题E:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity面试题F:https://blog.csdn.net/VRunSoftYanlz/article/details/78630945
++++Cocos2dx面试题:https://blog.csdn.net/VRunSoftYanlz/article/details/78630967
++++禅道[zentao]:https://blog.csdn.net/VRunSoftYanlz/article/details/83964057
++++Lua快速入门篇(Xlua拓展):https://blog.csdn.net/VRunSoftYanlz/article/details/81173818
++++Lua快速入门篇(XLua教程):https://blog.csdn.net/VRunSoftYanlz/article/details/81141502
++++Lua快速入门篇(基础概述):https://blog.csdn.net/VRunSoftYanlz/article/details/81041359
++++框架知识点:https://blog.csdn.net/VRunSoftYanlz/article/details/80862879
++++游戏框架(UI框架夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80781140
++++游戏框架(初探篇):https://blog.csdn.net/VRunSoftYanlz/article/details/80630325
++++.Net框架设计:https://blog.csdn.net/VRunSoftYanlz/article/details/87401225
++++从零开始学架构:https://blog.csdn.net/VRunSoftYanlz/article/details/88095895
++++设计模式简单整理:https://blog.csdn.net/vrunsoftyanlz/article/details/79839641
++++专题:设计模式(精华篇):https://blog.csdn.net/VRunSoftYanlz/article/details/81322678
++++U3D小项目参考:https://blog.csdn.net/vrunsoftyanlz/article/details/80141811
++++Unity小游戏算法分析:https://blog.csdn.net/VRunSoftYanlz/article/details/87908365
++++Unity案例(Vehicle):https://blog.csdn.net/VRunSoftYanlz/article/details/82355876
++++UML类图:https://blog.csdn.net/vrunsoftyanlz/article/details/80289461
++++PowerDesigner简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86500084
++++Unity知识点0001:https://blog.csdn.net/vrunsoftyanlz/article/details/80302012
++++Unity知识点0008:https://blog.csdn.net/VRunSoftYanlz/article/details/81153606
++++U3D_Shader编程(第一篇:快速入门篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372071
++++U3D_Shader编程(第二篇:基础夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372628
++++Unity引擎基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78881685
++++Unity面向组件开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78881752
++++Unity物理系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78881879
++++Unity2D平台开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78882034
++++UGUI基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78884693
++++UGUI进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78884882
++++UGUI综合:https://blog.csdn.net/vrunsoftyanlz/article/details/78885013
++++Unity动画系统基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78886068
++++Unity动画系统进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78886198
++++Navigation导航系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78886281
++++Unity特效渲染:https://blog.csdn.net/vrunsoftyanlz/article/details/78886403
++++Unity数据存储:https://blog.csdn.net/vrunsoftyanlz/article/details/79251273
++++Unity中Sqlite数据库:https://blog.csdn.net/vrunsoftyanlz/article/details/79254162
++++WWW类和协程:https://blog.csdn.net/vrunsoftyanlz/article/details/79254559
++++Unity网络:https://blog.csdn.net/vrunsoftyanlz/article/details/79254902
++++Unity资源加密:https://blog.csdn.net/VRunSoftYanlz/article/details/87644514
++++PhotonServer简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86652770
++++编写Photon游戏服务器:https://blog.csdn.net/VRunSoftYanlz/article/details/86682935
++++C#事件:https://blog.csdn.net/vrunsoftyanlz/article/details/78631267
++++C#委托:https://blog.csdn.net/vrunsoftyanlz/article/details/78631183
++++C#集合:https://blog.csdn.net/vrunsoftyanlz/article/details/78631175
++++C#泛型:https://blog.csdn.net/vrunsoftyanlz/article/details/78631141
++++C#接口:https://blog.csdn.net/vrunsoftyanlz/article/details/78631122
++++C#静态类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630979
++++C#中System.String类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630945
++++C#数据类型:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity3D默认的快捷键:https://blog.csdn.net/vrunsoftyanlz/article/details/78630838
++++游戏相关缩写:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++UnityAPI.Rigidbody刚体:https://blog.csdn.net/VRunSoftYanlz/article/details/81784053
++++UnityAPI.Material材质:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303
++++UnityAPI.Android安卓:https://blog.csdn.net/VRunSoftYanlz/article/details/81843193
++++UnityAPI.AndroidJNI安卓JNI:https://blog.csdn.net/VRunSoftYanlz/article/details/81879345
++++UnityAPI.Transform变换:https://blog.csdn.net/VRunSoftYanlz/article/details/81916293
++++UnityAPI.WheelCollider轮碰撞器:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217
++++UnityAPI.Resources资源:https://blog.csdn.net/VRunSoftYanlz/article/details/83155518
++++JSON数据结构:https://blog.csdn.net/VRunSoftYanlz/article/details/82026644
++++CocosStudio快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/82356839
++++Unity企业内训(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82634668
++++Unity企业内训(第1讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82634733
++++Unity企业内训(第2讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82861180
++++Unity企业内训(第3讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82927699
++++Unity企业内训(第4讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83479776
++++Unity企业内训(第5讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83963811
++++Unity企业内训(第6讲):https://blog.csdn.net/VRunSoftYanlz/article/details/84207696
++++钻哥带您了解产品原型:https://blog.csdn.net/VRunSoftYanlz/article/details/87303828
++++插件<Obi Rope>:https://blog.csdn.net/VRunSoftYanlz/article/details/83963905
++++计算机组成原理(教材篇):https://blog.csdn.net/VRunSoftYanlz/article/details/82719129
++++5G接入:云计算和雾计算:https://blog.csdn.net/VRunSoftYanlz/article/details/88372718
++++云计算通俗讲义:https://blog.csdn.net/VRunSoftYanlz/article/details/88652803
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz
--_--VRunSoft:lovezuanzuan--_--
本文地址:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995
下一篇: 盘点2016 CES智能门锁哪家强?
推荐阅读
-
《UnityAPI.MovieTexture影片纹理》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+MovieTexture+audioClip+立钻哥哥++OK++)
-
《UnityAPI.Quaternion四元数》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Quaternion+Angle+Dot+Euler+立钻哥哥++OK++)
-
《UnityAPI.Camera摄像机》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+allCameras+cullingMask+OnPreCull+立钻哥哥++OK+)
-
《UnityAPI.ParticleSystem粒子系统》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Particle+loop+Emit+立钻哥哥++OK++)
-
《UnityAPI.ParticleSystemRenderer粒子系统渲染器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+alignment+立钻哥哥++OK++)
-
《Unity引擎中的Shader类和ShaderLab语言》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Unity+Shader+ShaderLab+立钻哥哥++OK+)
-
《UnityAPI.AnimationState动画状态》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+AnimationState+enabled+立钻哥哥++OK++)
-
《UnityAPI.Rigidbody刚体》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Rigidbody+isKinematic+AddForce+立钻哥哥++OK+)
-
《UnityAPI.StateMachineBehaviour状态机行为》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+OnStateUpdate+立钻哥哥++OK++)
-
《UnityAPI.Collision碰撞》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Collision+collider+rigidbody+立钻哥哥++OK++)