本文整理汇总了C#中ParticleSystem类的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem类的具体用法?C# ParticleSystem怎么用?C# ParticleSystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParticleSystem类属于命名空间,在下文中一共展示了ParticleSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
myTransform = GetComponent<Transform>();
myRigidBody = GetComponent<Rigidbody>();
myHealth = GetComponent<Health>();
BloodParticle = GetComponentInChildren<ParticleSystem>();
}
示例2: Start
// Start
void Start()
{
myParticleSystem = particleSystem;
// Server side doesn't compute particles
if(uLink.Network.isServer) {
// Disable emission
myParticleSystem.enableEmission = false;
if(!myParticleSystem.isStopped)
myParticleSystem.Stop();
// Is there a delayed explosion component?
var delayedExplosion = GetComponent<DelayedExplosion>();
// Destroy this object after the standard duration of the particle system
if(delayedExplosion == null)
Destroy(gameObject, myParticleSystem.duration);
else
Destroy(gameObject, delayedExplosion.delayTime + 0.1f);
// No LateUpdate on the server
enabled = false;
}
}
示例3: Awake
void Awake()
{
rb2d = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
aud = GetComponent<AudioSource>();
jps = transform.GetChild(2).GetComponent<ParticleSystem>();
}
示例4: Start
void Start()
{
characterController = GetComponent<CharacterController>();
characterParticles = GameObject.Find("Player/Flute Radius").GetComponent<ParticleSystem>();
fluteCall1 = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/flute1");
fluteCall2 = FMOD_StudioSystem.instance.GetEvent("event:/sfx/player/flute2");
}
示例5: Start
// Use this for initialization
void Start()
{
//Hämtar bara referenser 1 gång, GetComponent är väldigt långsam!!!
rb2d = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
ps = GetComponent<ParticleSystem>();
}
示例6: OnEnable
void OnEnable()
{
_particleSystem = GetComponent<ParticleSystem>();
StopAllCoroutines();
StartCoroutine("ParticleProcess");
}
示例7: AffectParticles
public override void AffectParticles( ParticleSystem system, float timeElapsed )
{
Vector3 scaledVector = Vector3.Zero;
if ( forceApp == ForceApplication.Add )
{
// scale force by time
scaledVector = forceVector * timeElapsed;
}
// affect each particle
for ( int i = 0; i < system.Particles.Count; i++ )
{
Particle p = (Particle)system.Particles[ i ];
if ( forceApp == ForceApplication.Add )
{
p.Direction += scaledVector;
}
else
{ // Average
p.Direction = ( p.Direction + forceVector ) / 2;
}
}
}
示例8: Start
//private GameObject streamRight;
//private GameObject streamCentre;
//private ParticleSystem streamLeftP;
//private ParticleSystem streamRightP;
//private ParticleSystem streamCentreP;
void Start()
{
instance = this;
anim = GameObject.Find ("Portal_").GetComponent<Animator> ();
text = GameObject.Find ("Text");
textEnter = GameObject.Find ("Text_Enter");
transition = GameObject.Find ("TransitionTemp").GetComponent<Animator>();
galaxy1 = GameObject.Find ("Galaxy1").GetComponent<ParticleSystem>();
galaxy1_1 = GameObject.Find ("Galaxy1_1").GetComponent<ParticleSystem>();
galaxy1_1_1 = GameObject.Find ("Galaxy1_1_1").GetComponent<ParticleSystem>();
galaxy1_2 = GameObject.Find ("Galaxy1_2").GetComponent<ParticleSystem>();
galaxy1_3 = GameObject.Find ("Galaxy1_3").GetComponent<ParticleSystem>();
galaxy2 = GameObject.Find ("Galaxy2").GetComponent<ParticleSystem>();
galaxy2_1 = GameObject.Find ("Galaxy2_1").GetComponent<ParticleSystem>();
galaxy2_1_1 = GameObject.Find ("Galaxy2_1_1").GetComponent<ParticleSystem>();
galaxy2_2 = GameObject.Find ("Galaxy2_2").GetComponent<ParticleSystem>();
galaxy2_3 = GameObject.Find ("Galaxy2_3").GetComponent<ParticleSystem>();
galaxy3 = GameObject.Find ("Galaxy3").GetComponent<ParticleSystem>();
galaxy3_1 = GameObject.Find ("Galaxy3_1").GetComponent<ParticleSystem>();
galaxy3_1_1 = GameObject.Find ("Galaxy3_1_1").GetComponent<ParticleSystem>();
galaxy3_2 = GameObject.Find ("Galaxy3_2").GetComponent<ParticleSystem>();
galaxy3_3 = GameObject.Find ("Galaxy3_3").GetComponent<ParticleSystem>();
//streamRightP = GameObject.Find ("StreamRight").GetComponent<ParticleSystem>();
//streamCentreP = GameObject.Find ("StreamCentre").GetComponent<ParticleSystem>();
//streamLeft = GameObject.Find ("StreamLeft");
//streamRight = GameObject.Find ("StreamRight");
//streamCentre = GameObject.Find ("StreamCentre");
}
示例9: PuffGroundFX_End
void PuffGroundFX_End()
{
if (PuffGroundParticleSystem != null) {
PuffGroundParticleSystem.loop = false;
PuffGroundParticleSystem = null;
}
}
示例10: Awake
void Awake()
{
Instance = this;
hearts = transform.FindChild("HeartParticles").GetComponent<ParticleSystem>();
rb = GetComponent<Rigidbody2D>();
animator = GetComponent<Animator>();
}
示例11: Update
// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown (0)) {
clone = Instantiate (shotEffectPrefab, transform.position, transform.rotation) as ParticleSystem;
clone.Play ();
}
}
示例12: Start
// Use this for initialization
void Start()
{
tx = transform;
starDistanceSqr = starDistance * starDistance;
starClipDistanceSqr = starClipDistance * starClipDistance;
particleSystem = GetComponent<ParticleSystem> ();
}
示例13: Awake
void Awake()
{
m_time = 0f;
m_isFireing = false;
m_particleSystem = GetComponent<ParticleSystem>();
m_lineRenderer = GetComponent<LineRenderer>();
}
示例14: Start
protected void Start()
{
particleComponent = GetComponent<ParticleSystem>();
particleEmission = particleComponent.emissionRate;
particleComponent.emissionRate = TOD_Sky.Instance.IsDay ? particleEmission : 0;
}
示例15: Awake
void Awake ()
{
capsuleCollider = GetComponent <CapsuleCollider> ();
currentHealth = startingHealth;
hitParticles = GetComponentInChildren <ParticleSystem> ();
animator = GetComponent<Animator> ();
}