本文整理汇总了C#中UnityEngine.ParticleSystem.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.Clear方法的具体用法?C# ParticleSystem.Clear怎么用?C# ParticleSystem.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem.Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEnter
public override void OnEnter()
{
ps = Fsm.GetOwnerDefaultTarget(gameObject).GetComponent<ParticleSystem>();
if (delay.Value <= 0)
{
if (clear.Value) {
stopWithClear.Value = false;
ps.Clear();
}
else {
ps.Stop();
ps.Clear();
}
if(finishEvent != null) Fsm.Event(finishEvent);{
Finish();
return;
}
}
startTime = Time.realtimeSinceStartup;
timer = 0f;
}
示例2: Start
// Use this for initialization
void Start()
{
part = GetComponent<ParticleSystem>();
audio = GetComponent<AudioSource>();
part.Stop();
part.Clear();
}
示例3: Start
// Use this for initialization
void Start()
{
part = transform.FindChild( "ShockwaveParticleSystem" ).gameObject.GetComponent<ParticleSystem>();
part.Clear();
part.enableEmission = false;
transform.localScale = new Vector3( 0, 0, 0 );
shouldPlay = false;
}
示例4: charge
public void charge(GameObject particles)
{
partSys = particles.GetComponent<ParticleSystem> ();
if (currentBattery < maxBattery) {
partSys.Pause ();
isCharging = true;
} else
partSys.Clear ();
}
示例5: Start
// private PlayerController playerScript;
// Use this for initialization
void Start()
{
GameObject.Find ("Loading Screen").GetComponent<Canvas> ().enabled = false;
attributesScript = this.GetComponent<PlayerAttributes> ();
levelUp = GameObject.Find ("LevelUp").GetComponent<ParticleSystem> ();
levelUp.enableEmission = false;
levelUp.Clear ();
//playerScript = this.GetComponent<PlayerController> ();
}
示例6: Start
// Use this for initialization
void Start()
{
chargingEffectIn = GetComponent<ParticleSystem>();
rb = GetComponent<Rigidbody>();
position = new Vector3(transform.position.x, 0.0f, transform.position.z);
isHere = false;
chargingEffectIn.Stop();
chargingEffectIn.Clear();
rotationY.Set(0f, 0f, 0f);
rotationY = rotationY.normalized*tumble;
Quaternion deltaRotation = Quaternion.Euler(rotationY);
//print("charger:" + position.x + " " + position.z);
}
示例7: Awake
void Awake()
{
lights = gameObject.GetComponentsInChildren<Light>();
flames = gameObject.GetComponentInChildren<ParticleSystem>();
if ((row == 0 || row == 2) || (column == 0 || column == 2))
{
lights[0].enabled = false;
lights[1].enabled = false;
lights[2].enabled = false;
flames.Pause();
flames.Clear();
isActive = false;
}
puzzleManager = GameObject.FindObjectOfType<LightsOn>();
}
示例8: AutoReleaseParticle
public IEnumerator AutoReleaseParticle(string prefabName, ParticleSystem particle, PrefabPoolAgent agent)
{
yield return new WaitForSeconds(particle.startDelay + 0.25f);
GameObject go = particle.gameObject;
while (particle.IsAlive(true) && go.activeInHierarchy)
{
yield return null;
}
if (go.activeInHierarchy)
{
Despawn(prefabName, agent);
particle.Clear(true);
}
}
示例9: ListenToDespawn
protected IEnumerator ListenToDespawn(ParticleSystem emitter)
{
// Wait for the delay time to complete
// Waiting the extra frame seems to be more stable and means at least one
// frame will always pass
yield return new WaitForSeconds(emitter.startDelay + 0.25f);
while (emitter.IsAlive(true))
{
if (!emitter.gameObject.activeInHierarchy)
{
emitter.Clear(true);
yield break; // Do nothing, already despawned. Quit.
}
yield return null;
}
// Turn off emit before despawning
InstanceManager.Despawn(this.poolName, emitter.transform);
}
示例10: Start
public void Start()
{
god = GameObject.Find("God").GetComponent<SoundGod>();
tickTime = 1.0 / goldTicksPerSecond;
tickTimer = 0.0;
carController = transform.parent.transform.parent.GetComponent<StephenCarController>();
line = gameObject.GetComponent<LineRenderer>();
system = gameObject.transform.GetChild(0).transform.GetChild(0).GetComponentInChildren<ParticleSystem>();
system.enableEmission = false;
system.Clear();
//EraseLine();
}
示例11: Start
// Use this for initialization
protected virtual void Start()
{
// set the primaryNode to the Weapons_Primary
var primaryNode = transform.FindChild("Weapons_Primary");
// Checks the child count of primaryNode
for (int i = primaryNode.transform.childCount - 1; i >= 0; i--)
{
// set weapon to instanstiate a GameObject as a Weapon
var weapon = GameObject.Instantiate(PrimaryWeapon, primaryNode.GetChild(i).transform.position, primaryNode.transform.rotation) as Weapon;
// set weapons parents to the primaryNode
weapon.transform.parent = primaryNode;
// add the weapon to the list of primaryWeapons
primaryWeapons.Add(weapon);
}
// set speed to calculate the speed
speed = CalculateSpeed();
// if shield is not null
if (Shield != null)
// get the collider2D component
shieldCollider = Shield.GetComponent<Collider2D>();
// set smoking and fire effects to false
isSmoking = false;
isOnFire = false;
//load particle effect SMOKE
smoke = (GameObject)Instantiate(Resources.Load("SmokeParticleSystem"));
smoke.transform.parent = this.gameObject.transform;
smokeSystem = smoke.GetComponent<ParticleSystem> ();
smokeSystem.Clear ();
smokeSystem.Stop();
//load particle effect FIRE
fire = (GameObject)Instantiate(Resources.Load("FireParticleSystem"));
fire.transform.parent = this.gameObject.transform;
fireSystem = fire.GetComponent<ParticleSystem> ();
fireSystem.Clear ();
fireSystem.Stop();
}
示例12: Start
void Start ()
{
m_Particle = Instantiate(m_Particle, this.transform.position, this.transform.rotation) as ParticleSystem;
m_Particle.Stop();
m_Particle.Clear();
}
示例13: Awake
// Private Functions
// Awake(): is called at the start of the program
void Awake()
{
// Singleton
if (s_Instance == null)
s_Instance = this;
else
Destroy(this.gameObject);
float resultColor;
// while: Initialise a color and checks if the color is acceptable
// Since HSV input of colors is harder to implement,
// it converts RGB into one OVERALL value and check if is within fMinimumArtilleryRGB and fMaximumArtilleryRGB range
do
{
colorArtillery = new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value, 1f);
resultColor = colorArtillery.r + colorArtillery.g + colorArtillery.b;
} while (resultColor < 3f * fMinimumArtilleryRGB || resultColor > 3f * fMaximumArtilleryRGB);
// Read level specific settings from Settings.cs
colorArtillery = Settings.s_EnvironmentColor;
fNutrientsChance = Settings.s_fPlayerNutrientChance;
fWallSidesSpeed = Settings.s_fSideWallSpeed;
fWallBackgroundSpeed = Settings.s_fBackgroundSpeed;
// Background particle system set-up
bgParticleSystem = transform.GetChild(2).GetComponent<ParticleSystem>();
// Use the same color as the wall-sides and background
bgParticleSystem.startColor = colorArtillery;
// Set the starting speed from Settings.cs
bgParticleSystem.startSpeed = Settings.s_fParticleStartSpeedMultiplier;
// Since prewarm of particle systems doesn't adapt to the new color, the particle system will be simulated beforehand
bgParticleSystem.Clear();
bgParticleSystem.Simulate(bgParticleSystem.startLifetime);
bgParticleSystem.Play();
mAnimate = new Animate(transform.GetChild(0)); // Pool_WallSidesRenderer
}
示例14: ListenForEmitDespawn
private IEnumerator ListenForEmitDespawn(ParticleSystem emitter)
{
yield return new WaitForSeconds(emitter.startDelay + 0.25f);
float safetimer = 0;
GameObject emitterGO = emitter.gameObject;
while (emitter.IsAlive(true) && emitterGO.activeInHierarchy)
{
safetimer += Time.deltaTime;
if (safetimer > MaxParticleDespawnTime)
{
Debug.LogWarning
(
string.Format
(
"SpawnPool {0}: " +
"Timed out while listening for all particles to die. " +
"Waited for {1}sec.", PoolName, MaxParticleDespawnTime
)
);
}
yield return null;
}
if (emitterGO.activeInHierarchy)
{
Despawn(emitter.transform);
emitter.Clear(true);
}
}
示例15: particleToggle
/// <summary>
/// Enables or disables the specified particle system
/// </summary>
/// <param name="partSys">Particle system to enable.</param>
/// <param name="toggle">If set to <c>true</c> system will be enabled.</param>
void particleToggle(ParticleSystem partSys, bool toggle){
if (toggle){
partSys.enableEmission = toggle;
partSys.Simulate(3);
partSys.Play();
}
else {
partSys.Stop();
partSys.Clear();
}
}