本文整理汇总了C#中ParticleSystem类的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem类的具体用法?C# ParticleSystem怎么用?C# ParticleSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParticleSystem类属于命名空间,在下文中一共展示了ParticleSystem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
myTransform = GetComponent<Transform>();
myRigidBody = GetComponent<Rigidbody>();
myHealth = GetComponent<Health>();
BloodParticle = GetComponentInChildren<ParticleSystem>();
}
开发者ID:Xellss,项目名称:StrangeRituals,代码行数:7,代码来源:EnemyController.cs
示例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;
}
}
开发者ID:judah4,项目名称:battle-of-mages,代码行数:26,代码来源:AutoDestruct.cs
示例3: Awake
void Awake()
{
rb2d = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
aud = GetComponent<AudioSource>();
jps = transform.GetChild(2).GetComponent<ParticleSystem>();
}
开发者ID:9,项目名称:Swordface2.5D,代码行数:7,代码来源:IcosaEnemyBrain.cs
示例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");
}
开发者ID:mightypants,项目名称:apackofalpacas,代码行数:7,代码来源:PlayerMovement.cs
示例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>();
}
开发者ID:Sn8z,项目名称:TDDD23,代码行数:8,代码来源:PlayerControllerScript.cs
示例6: OnEnable
void OnEnable()
{
_particleSystem = GetComponent<ParticleSystem>();
StopAllCoroutines();
StartCoroutine("ParticleProcess");
}
开发者ID:YangJinwoo,项目名称:2DGame,代码行数:7,代码来源:AutoDestroyParticle.cs
示例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;
}
}
}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:25,代码来源:LinearForceAffector.cs
示例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");
}
开发者ID:HoneyTribe,项目名称:Labirynth,代码行数:39,代码来源:TimePortalController.cs
示例9: PuffGroundFX_End
void PuffGroundFX_End()
{
if (PuffGroundParticleSystem != null) {
PuffGroundParticleSystem.loop = false;
PuffGroundParticleSystem = null;
}
}
开发者ID:wang-yichun,项目名称:Sadyrinth,代码行数:7,代码来源:EngineCheckerHandler.cs
示例10: Awake
void Awake()
{
Instance = this;
hearts = transform.FindChild("HeartParticles").GetComponent<ParticleSystem>();
rb = GetComponent<Rigidbody2D>();
animator = GetComponent<Animator>();
}
开发者ID:CharAlis,项目名称:IndiesVSGamers,代码行数:7,代码来源:Brockontroller.cs
示例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 ();
}
}
开发者ID:almudi,项目名称:JorgAnd,代码行数:8,代码来源:PistolFire.cs
示例12: Start
// Use this for initialization
void Start()
{
tx = transform;
starDistanceSqr = starDistance * starDistance;
starClipDistanceSqr = starClipDistance * starClipDistance;
particleSystem = GetComponent<ParticleSystem> ();
}
开发者ID:jvdwijk,项目名称:Asteroidsss,代码行数:8,代码来源:InfiniteStarfield.cs
示例13: Awake
void Awake()
{
m_time = 0f;
m_isFireing = false;
m_particleSystem = GetComponent<ParticleSystem>();
m_lineRenderer = GetComponent<LineRenderer>();
}
开发者ID:migg32,项目名称:UnityTest,代码行数:7,代码来源:LaserPistol.cs
示例14: Start
protected void Start()
{
particleComponent = GetComponent<ParticleSystem>();
particleEmission = particleComponent.emissionRate;
particleComponent.emissionRate = TOD_Sky.Instance.IsDay ? particleEmission : 0;
}
开发者ID:TK-97,项目名称:ICO_AGM_Asg02,代码行数:7,代码来源:TOD_ParticleAtDay.cs
示例15: Awake
void Awake ()
{
capsuleCollider = GetComponent <CapsuleCollider> ();
currentHealth = startingHealth;
hitParticles = GetComponentInChildren <ParticleSystem> ();
animator = GetComponent<Animator> ();
}
开发者ID:klemen-skoda,项目名称:RGTI-2016-unity-game,代码行数:7,代码来源:enemyHP.cs
示例16: Set_SmallSteam
private void Set_SmallSteam()
{
_pSmall.SetActive (true) ;
_pMedium.SetActive (false) ;
_p = _pSmall.GetComponent<ParticleSystem>() ;
_p.enableEmission = false ;
}
开发者ID:Gelatos,项目名称:CastleOfSteam,代码行数:7,代码来源:Steam_Controller.cs
示例17: Start
void Start()
{
controller = new Controller ();
controller.EnableGesture (Gesture.GestureType.TYPE_SWIPE);
controller.EnableGesture (Gesture.GestureType.TYPE_CIRCLE);
controller.EnableGesture (Gesture.GestureType.TYPE_SCREEN_TAP);
//for swipe
controller.Config.SetFloat ("Gesture.Swipe.MinLength", 200.0f);
controller.Config.SetFloat ("Gesture.Swipe.MinVelocity", 750f);
//for circle
controller.Config.SetFloat ("Gesture.Circle.MinRadius", 80.0f);
controller.Config.SetFloat ("Gesture.Circle.MinArc", 1.8f);
//for screen tap
controller.Config.SetFloat ("Gesture.ScreenTap.MinForwardVelocity", 1.0f);
controller.Config.SetFloat ("Gesture.ScreenTap.HistorySeconds", .05f);
controller.Config.SetFloat ("Gesture.ScreenTap.MinDistance", 1.0f);
controller.Config.Save ();
timeLimit = 5.0f;
timer = 0.0f;
p = GameObject.Find ("ps").GetComponent<ParticleSystem> ();
before = GameObject.Find ("before").GetComponent<SpriteRenderer> ();
after = GameObject.Find ("after").GetComponent<SpriteRenderer> ();
after.color = new Color (255, 255, 255, 0);
p.Pause ();
}
开发者ID:Sunghyo,项目名称:fashionstory,代码行数:29,代码来源:Sh.cs
示例18: CreateAffector
public override ParticleAffector CreateAffector( ParticleSystem psys )
{
ParticleAffector p = new LinearForceAffector( psys );
affectorList.Add( p );
return p;
}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:LinearForceAffectorFactory.cs
示例19: Start
void Start()
{
stateController = GameObject.FindWithTag("Player").GetComponent<TurtleStateController>();
forceVector = transform.forward * magnitude;
particleSystem = GetComponent<ParticleSystem>();
particleSystem.Play();
}
开发者ID:piinecone,项目名称:prototype3,代码行数:7,代码来源:DirectionalCurrentBehavior.cs
示例20: AffectParticle
public override void AffectParticle(ref ParticleSystem.Particle p, float dt)
{
// This math is much easier in local space
if (particleController.IsWorldSpace()) {
particleController.InverseTransformParticle(ref p);
}
Vector3 r = p.position - centerOffset;
float radius = r.magnitude;
Vector3 ac = Vector3.Cross(up, r.normalized);
ac.Normalize();
if (acceleration)
{
ac *= linearTangentalAcceleration * dt;
Vector3 cf = ((r * ac.sqrMagnitude) / radius) * centrifugalCoef;
p.velocity += ac + cf;
}
else
{
ac *= linearTangentalAcceleration;
p.velocity = ac;
}
if (particleController.IsWorldSpace()) {
particleController.TransformParticle(ref p);
}
}
开发者ID:lightfromshadows,项目名称:qadunity,代码行数:28,代码来源:VortexAffector.cs
注:本文中的ParticleSystem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论