はじめに
前編では、パーティクル素材の作り方やUnityでの色の付け方を紹介しました
後編では、星を上から降らせたり、ランダムにサイズを変える方法について解説します
星の降らせ方
Particle Systemの Shape を Edge に設定し、Rotation のZ軸を180に設定しましょう
Shapeでパーティクルを放出する形状を決めることができます
Position や Rotation で位置や角度を変えられます

画面上部からパーティクルが放出するようにPositionのY軸を設定してみましょう
Shapeの位置はSceneビューから確認することができます

次に、画面全体から星を降らせるようにします
同様にShape 内、 Scale のX軸を画面いっぱいに拡大します
※Scaleについては、代わりにRadiusを広げても同じ結果になります

Shapeは画面外の上に配置すると良い感じに見えます

パーティクルの数の増やし方
パーティクルの数は、Particle System の Emission > Rate over Time の数値を上げると増えます
お好みで自由に設定しましょう


パーティクルのサイズと速度をランダムに設定しよう
さらにクオリティを上げるために、パーティクルのサイズや速度を変化させてみましょう
Particle System > Start Speed とStart Size を右にある矢印から、Random between two colorsに切り替えて適当な値を設定します

一気に良い感じになってきました

パーティクルを回転させよう
今のままでは、星が同じ向きなので、回転させてさらなるクオリティアップを図ります
Particle System > Start Rotation を Random between two colors に切り替え、0〜360度に設定します
これで、パーティクルが様々な向きで放出されます

落下中に回転させるには、Particle System > Rotation over Lifetime にチェックを入れます
完成
星を降らせることができました
パラメーターをランダムにすることで、見栄えが良くなりますね
