Ejemplo n.º 1
0
 /// <summary>
 /// Same as the <see cref="Galaxia.Galaxy.GenerateParticles()"/> but for a specific <see cref="Galaxia.ParticlesPrefab"/>
 /// </summary>
 /// <param name="prefab">The Particles Prefab to use for the generation</param>
 public void GenerateParticles(ParticlesPrefab prefab)
 {
     if (GalaxyPrefab != null)
     {
         if (prefab != null)
         {
             GameObject obj = new GameObject(prefab.name, typeof(Particles));
             obj.transform.SetParent(transform);
             Particles p = obj.GetComponent <Particles>();
             p.Init();
             p.Generate(prefab, GalaxyPrefab, GPU);
             particles.Add(p);
             prefab.CreateMaterial(GalaxyPrefab, GPU);
             prefab.UpdateMaterial(GalaxyPrefab);
         }
         else
         {
             Debug.LogError("Particle Prefab was destroyed or missing");
         }
     }
     else
     {
         Debug.LogWarning("No Prefab assigned");
     }
 }