An open source Danmaku development kit for Unity3D.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Updated Firing Your First Bullet docs

authored by

Phillip Spiess and committed by
James Liu
4f2c5fbb 4831fca3

+67 -3
+67 -3
docs/guides/getting_started/firing_your_first_bullet.md
··· 1 1 2 2 # Creating the Danmaku Manager singleton 3 3 > [!IMPORTANT] 4 - > It is actually discouraged to call `DontDestoryOnLoad` on the Danmaku Manager 4 + > It is discouraged to call `DontDestoryOnLoad` on the Danmaku Manager 5 5 > component to allow it to survive a scene load. If you must keep it across scene 6 6 > loads, remember to release the data it owns periodically. 7 7 8 - The main required component need for everything in DanmakU to function in the 9 - **Danmaku Manager** component. 8 + The power of **DanmakU** comes from the scripting together @DanmakU.Fireables 9 + and @DanmakU.Modifiers to create complex patterns. Included in the package is 10 + a simple emitter that is intended to be a jumping off point for more complex 11 + behaviors. This guide walks you through setting up a scene with an emitter 12 + continually firing. 13 + 14 + ## Your First Bullet 15 + 1. Make sure you have completed the installation instructions. 16 + 17 + 1. Select `File -> New Scene` to create a new scene 18 + 19 + 1. Create an empty game object in the scene. Click `Add Component` and add a 20 + @Danmaku.DanmakuManager component to the scene. 21 + 22 + Name it `Danmaku Manager` (the name isn't actually important, but it helps 23 + disambiguate it in the scene.) 24 + 25 + The @Danmaku.DanmakuManager manages the danmaku (bullets) in your scene, and 26 + it controls the bounds for danmaku.. 27 + 28 + Keep everything default for now. Later, you can use the Center and Extents 29 + properties to change the size of the area where bullets will automatically 30 + despawn. 31 + 32 + Your scene must have a DanmakuManager object. **DanmakU will fail to run 33 + without one.** 34 + 35 + 1. Add another empty game object to the scene. This time, add a 36 + @Danmaku.DanmakuPrefab component to the object. 37 + 38 + Name it `Danmaku Prefab`. This object will be the template we use for our bullets. 39 + 40 + @Danmaku.DanmakuPrefab defines a bullet type for your game. It contains a 41 + reference to the shader, sprite (or mesh), and collision information for 42 + that bullet type. 43 + 44 + 1. Included with the project is a sprite called `Big1`. Drag it onto the 45 + `Rendering->Sprite` field of `Danmaku Prefab` 46 + 47 + 1. In the `Danmaku\Runtime\Shaders` folder there is a file called 48 + `Default Sprite Danmaku`. Drag this to the `Rendering->Shader` property for the 49 + `Danmaku Prefab` game object. Leave all the other fields their default values. 50 + 51 + 1. Add a third empty game object. Add a @Danmaku.DanmakuEmitter component to it. 52 + 53 + Name it `Danmaku Emitter`. Make sure it is positioned at (0, 0, 0), as bullets 54 + will be emitted from it. 55 + 56 + The @Danmaku.DanmakuEmitter class is a simple bullet emitter meant to be a 57 + jumping off point for your own emitter types. It shows how you can compose 58 + many behaviors together to create different patterns. 59 + 60 + 1. Drag `Danmaku Prefab` on the `Danmaku Type` field of `Danmaku Emitter`. 61 + 62 + 1. Expand `Arc`, if it is not already, and change `Arc->Count` to 1. 63 + 64 + 1. Press play. You should see a steady stream of bullets being fired to the right. 65 + 66 + 1. Stop the game and change `Fire Rate` to 1, `Arc->Count` to 3, 67 + `Arc-Length` to 30, `Line->Count` to 3, and `Line->Delta Speed` to 2. 68 + 69 + 1. Continue playing with the properties of `Danmaku Emitter`, including the 70 + position and rotation of the gameobject. 71 + 72 + > [!NOTE] 73 + > You may need to adjust your Main Camera settings, and the import settings for the Big1 image to get the bullets to be the correct size.