當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。