本文整理汇总了C#中UnityEngine.ParticleSystem.Simulate方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.Simulate方法的具体用法?C# ParticleSystem.Simulate怎么用?C# ParticleSystem.Simulate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem.Simulate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init(Main main)
{
currentValue = UnityEngine.Random.Range (minimum, maximum);
transform.localScale = new Vector3 (main.LocationWidthInMeters / 2, 1, 1);
transform.localPosition = new Vector3 (transform.localScale.x, main.LocationHeightInMeters + 1, 0);
particles = GetComponent<ParticleSystem> ();
particles.emissionRate = CalculateCurrentEmissionRate();
particles.Simulate (1);
particles.Play ();
}
示例2: Splash
void Splash()
{
ps = GetComponent<ParticleSystem> ();
ps.Simulate (0);
ps.Play ();
GetComponent<Renderer> ().enabled = false;
foreach (Collider2D other in Physics2D.OverlapCircleAll (new Vector2 (rb.position.x, rb.position.y), splashRadius))
if (other.tag == "Enemy")
other.gameObject.AddComponent<DoT> ().Initialize (dps, duration);
}
示例3: 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
}
示例4: 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();
}
}