Esempio n. 1
0
    void createParticleSystem(Vector3 origin)
    {
        Vector3 particleSystemLocation = new Vector3(origin.x, origin.y, -10);
        Vector3 velocity     = new Vector3(1f, 3f, 0f);
        float   lifeTime     = 5f;
        float   startSpeed   = Random.Range(-3f, 0f);
        int     maxParticles = 1000;

        psf2 = new particleSystemFigure2(particleSystemLocation, startSpeed, velocity, lifeTime, maxParticles);
    }
Esempio n. 2
0
    void createParticleSystem(Vector3 origin, GameObject parentParticleSystem)
    {
        Vector3 particleSystemLocation = new Vector3(origin.x, origin.y, -10);
        Vector3 velocity     = new Vector3(1f, 3f, 0f);
        float   lifeTime     = 5f;
        float   startSpeed   = Random.Range(-3f, 0f);
        int     maxParticles = 1000;
        //Create the child particle system
        particleSystemFigure2 child = new particleSystemFigure2(particleSystemLocation, startSpeed, velocity, lifeTime, maxParticles);

        //Now let's go ahead and give the child a parent particle system
        child.particleSystemGameObject.transform.SetParent(psf2.particleSystemGameObject.transform);

        //Now let's turn on the inherit velocity module
        child.inheritVelocityModule();
    }