using UnityEngine;
using System.Collections;
public class ParticleTest : MonoBehaviour
{
// Use this for initialization
void Start ()
{
ParticleSystem particleSystem = GetComponent<ParticleSystem> ();
int num = 5000;
particleSystem.Emit (num);
ParticleSystem.Particle[] particle = new ParticleSystem.Particle[num];
particleSystem.GetParticles(particle);
particleSystem.Pause();
for (var i = 0; i < num; i++)
{
particle [i].position = new Vector3 (
(Random.value-0.5f)*100f,
(Random.value-0.5f)*100f,
(Random.value-0.5f)*100f
);
}
particleSystem.SetParticles(particle,num);
}
}
More than 5 years have passed since last update.
ParticleSystemとスクリプトで星空的なものを作る
Last updated at Posted at 2017-03-22
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme