Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by psantimauro · Nov 15, 2012 at 07:06 AM · particle systemshurikenlegacybest practices

Whats the best way to create a 'legacy' particle system?

I am currently working through the book "Unity 3.x Game Development Essentials". In chapter 8 they introduce particle systems. The description of how to configure the particles systems wasn't matching what I was seeing in Unity 3.5.6f4. After some Googling I realized that they are referring to the 'legacy particles system', not the Shuriken system.

I managed to create a legacy particle system by creating a particle system from the Hierarchy then applying an emitter, renderer and animator to it from the Component->Effects->Legacy Particles menu and removing the 'Particle System'. Using this method I had to re-apply a material in the renderer for it to work. As outlined in another question.

Is there a simpler way to create a legacy particle system? They way I did it seems a little clunky..

Thanks!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Screenhog · Nov 27, 2012 at 07:07 PM 0
Share

You didn't have to start with a Particle System... you could have just started with an empty GameObject and then added those components. That's what I generally do if I happen to need the Legacy Particle System for some reason (alas, there are still a few things that Shuriken can't do).

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by clunk47 · Nov 27, 2012 at 05:49 AM

This will make it really easy. FIRST, in your ASSETS folder, create a new folder and name it Editor. In the new Editor folder, create a C-Sharp Script and name it MyWindow. Now just copy and paste the following code to that script. This will create a new menu in Unity called "Custom", when you go to it select "Add > Particles > Ellipsoid Particle Emitter". Done. You still have to add a material but this makes it WAY less of a pain to use legacy particles. This just creates a new empty game object and adds all necessary components. Let me know if you have any issues. Notice the class name in the script is MyWindow. Make sure to name the script MyWindow for this reason.

///////////////////////////////////////////////////////////////////////////////////

 using UnityEditor;
 using UnityEngine;
 
 class MyWindow : EditorWindow
 {
     [MenuItem("Custom/Add/Particles/Ellipsoid Particle Emitter")]
     static void AddEllipsoidParticleEmitter()
     {
         GameObject epe = new GameObject("Ellipsoid Particle Emitter");
         epe.AddComponent("EllipsoidParticleEmitter");
         epe.AddComponent<ParticleAnimator>();
         epe.AddComponent<ParticleRenderer>();
     }
 }
Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Nov 27, 2012 at 07:17 AM 2
Share

Nice answer, especially including the Editor folder, thumb Up. I have made the same thing in uJS, but an unable to attach the Default-Particle material. Do you know how to do this from an Editor / Context $$anonymous$$enu command?

http://answers.unity3d.com/questions/344911/how-to-find-and-assign-a-native-shader-to-a-render.html

http://answers.unity3d.com/questions/348041/list-of-all-default-unity-shaders.html

Thanks =]

avatar image psantimauro · Nov 27, 2012 at 04:19 PM 1
Share

I haven't tried this yet, but it looks great. A lot easier than what I was doing...
And I learned how to make custom menu items!

Thanks for the response.

avatar image clunk47 · Nov 27, 2012 at 06:59 PM 1
Share

You have to create your own material, but this will be a one-time thing. Here is an updated version of the script I posted before. In order for this script to work correctly as is, Create a new Folder in Assets folder named Resources. Create a new folder in Resources called $$anonymous$$aterials. Create another new folder in Resources called Textures. Here is a circle gradient you can use for now to test. Save this image to your new texture folder "Resources/Textures" CircleGradient.png Not that you will need the background of this image to be BLAC$$anonymous$$ to appear correctly as particles. Then you would select the texture in Unity Inspector and under options, check the box "Alpha From Grayscale". $$anonymous$$ake sure to name this texture Particle to work w/ this specific code.

Now go to your $$anonymous$$aterials folder "Resources/$$anonymous$$aterials" and create a new $$anonymous$$aterial, name it Custom-Particle. That's it. The script will do the rest. This will add the legacy particle system, assign a material, shader, and texture. Once you do all of this, it will be the only time you have to do it. From here on just go to Custom / Add / Particles / Ellipsoid Particle Emitter and BA$$anonymous$$. Enjoy! ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 using UnityEditor;
 using UnityEngine;
 
 class $$anonymous$$yWindow : EditorWindow
 {
     [$$anonymous$$enuItem("Custom/Add/Particles/Ellipsoid Particle Emitter")]
     static void AddEllipsoidParticleEmitter()
     {
         GameObject epe = new GameObject("Ellipsoid Particle Emitter");
         epe.AddComponent("EllipsoidParticleEmitter");
         epe.AddComponent<ParticleAnimator>();
         epe.AddComponent<ParticleRenderer>();
         $$anonymous$$aterial material = Resources.Load ("$$anonymous$$aterials/Custom-Particle") as $$anonymous$$aterial;
         Texture2D texture = Resources.Load ("Textures/Particle") as Texture2D;
         Shader shader = Shader.Find("Particles/Alpha Blended Premultiply");
         epe.renderer.shared$$anonymous$$aterial = material;
         epe.renderer.shared$$anonymous$$aterial.mainTexture = texture;
         epe.renderer.shared$$anonymous$$aterial.shader = shader;
     }
 }
avatar image clunk47 clunk47 · Nov 27, 2012 at 08:01 PM 1
Share

If you take out the lines of this code that have to do with TEXTURE, you can just add the default-particle texture to your custom material in the inspector. Then it would be the same as the default material :D

avatar image clunk47 · Nov 27, 2012 at 07:19 PM 1
Share

Thanks alucardj, I also posted below how to do the materials, just in case someone wanted to know how to do it in C#. :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Remove wireframe on particle systems 3 Answers

Change colour of particles with C# 1 Answer

Shuriken particle spin 1 Answer

How can I scale Shuriken particle system? 2 Answers

Particle System Overhead 6 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges