当前位置: 首页>>代码示例>>C#>>正文


C# ParticleSystem.Simulate方法代码示例

本文整理汇总了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 ();
 }
开发者ID:kirgh,项目名称:StopKillingThem,代码行数:10,代码来源:Rain.cs

示例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);
    }
开发者ID:tvance989,项目名称:wizard-game,代码行数:12,代码来源:Poison.cs

示例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
    }
开发者ID:raynertanxw,项目名称:GDP_Cellulose,代码行数:40,代码来源:Wall.cs

示例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();
		}

	}
开发者ID:UnofficialSpaceHulkTeam,项目名称:UnofficialSpaceHulk,代码行数:17,代码来源:InputOutput.cs


注:本文中的UnityEngine.ParticleSystem.Simulate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。