Example #1
0
 private vrValue StartParticlesCommandHandler(vrValue iValue)
 {
     // We get all the randomSeed / playOnAwake of the master's particle systems
     // to sync the slaves.
     ParticleSystem[] particles = GameObject.FindObjectsOfType(typeof(ParticleSystem)) as ParticleSystem[];
     for (uint i = 0, iEnd = iValue.GetListItemsNb(), particlesCnt = (uint)particles.GetLength(0); i < iEnd && i < particlesCnt; ++i)
     {
         particles[i].randomSeed = (uint)iValue.GetListItem(i).GetListItem(0).GetInt();
         if (iValue.GetListItem(i).GetListItem(1).GetBool())
         {
             particles[i].Play();
         }
     }
     return(null);
 }
Example #2
0
 private vrValue StartParticlesCommandHandler(vrValue iValue)
 {
     // We get all the randomSeed / playOnAwake of the master's particle systems
     // to sync the slaves.
     ParticleSystem[] particles = GameObject.FindObjectsOfType(typeof(ParticleSystem)) as ParticleSystem[];
     for (uint i = 0, iEnd = iValue.GetListItemsNb(), particlesCnt = (uint)particles.GetLength(0); i < iEnd && i < particlesCnt; ++i)
     {
         particles[i].randomSeed = (uint)iValue.GetListItem(i).GetListItem(0).GetInt();
         if (iValue.GetListItem(i).GetListItem(1).GetBool())
         {
             particles[i].Play();
         }
     }
     return null;
 }