First download the asset from the Asset Store
Put the 'Galaxia' folder wherever you want. And you are ready to go!
The Folder includes:
Creating a simple Galaxy
Let's start by creating a new GameObject and assigning a Galaxy Component, like so:
Note that this is just a holder for our Galaxy. The real meat of the galaxy is theGalaxy Prefab.
The 'Galaxy' option is what we want to change.
Next we want to create a new Galaxy Prefab and populate it with our stars. The Galaxy Prefab is an asset, so to create one we must go to 'Assets/Create/Galaxy Prefab'.
After we have create a new Galaxy Prefab you will be greeted by and empty Galxy Prefab with a Density Wave Distributor
You can change your distributor at any time. Each distributor has it's own options.
We will start by creating a new Particle Prefab by clicking the 'Add' button. You will be prompted to a popup to choose the name and the preset (if any)
of your new Particle Prefab
After you have created the Particle Prefab, if you have Unity Pro you will see them in the Editor Scene View.
If you don't have Unity Pro, you will have to play the game to see the particles.
Let's see how it looks.
Keep in mind that your result's may look slightly different, especially if you use a Mac.
We can now change what we want on our Particle Prefab.
For example we can change the count of your particles to ONE MILLION PARTICLES muahaha!
Also let's make them a bit smaller let's say 0.3.
And here is what we get:
Now let's and some dust! Create a new Particle Prefab by Clicking 'Add' and choose a preset to Dust.
Let's make it a bit bigger with a size of 20 and cut down on the particles to 10000.
And there we have it! A simple galaxy with some dust and unnecessarily large amount of stars.
Customizing our Galaxy
Now that we have our basic Galaxy, the stars look a bit uniform. So we want to decrease the star count, and use a Perlin Distribution
for the size.
First of, if we are to use the perlin distribution we need to change the size distribution curve itself. The perlin distribution samples the distribution curve itself.
For low values we want the curve to be low and for high values we want it to be hight, that means a linear curve like so:
Then let's change the size distribution type to Perlin.
The trouble with that is that the perlin function is too uniform and our galaxy just looks like swiss cheese.
So we need to change the variation size, to something like 0.5. This will make the stars seem more uniform.
We will also need to also just the Frequency and amplitude of our noise like this:
Let's just lower the star count to 500,000 and see the result:
Looks good, but we have lost the bright glowing core. We can change that by adjusting the Size of our Dust particles to 7
Ah, mush better, but there is something missing. I know! Let's add some larger stars.
Create a new Particle Prefab with a 'Big Stars' preset and change the Count to 50,000.
Although big stars is better, making them get bigger as they approach the arms would be much better. This is where angle distribution comes in.
Choose 'Angle' as the size distribution type and adjust the curve like so:
And here is the final result: