新建Unity項目3D | 版本選擇 2022.3
| 導入Creator Kit: FPS資源 | 雙擊 ExampleScene | 點play 按鈕運行起來:
- W A S D 移動;Shift + W A S D 跑
- 空格跳躍
- 鼠標左鍵射擊目標
也可以自己自定義操作鍵:
Edit | Project settings | Input Manager.
展開 Horizontal 和 Vertical進行自定義修改即可。修改完 cmd+s保存。
? Customize the Germ Targets
?? Create your Own Level for the Game
To make your own copy: 菜單欄:FPSKIT > Create new Scene
, 命名為MyTestScene
然后雙擊 MyTestScene 打開:
Assets > Creator Kit - FPS > Prefabs > Targets 選中 GermSlimeTarget Prefab 拖到場景中:
?? Change Target Stats
可以自己修改 GermSlimeTarget的一些屬性值測試:
?? Create a New Target
到 Assets > Creator Kit - FPS > Art > Models > Characters, 選擇 GermSpike 拖到場景中:
給它添加剛體 “Rigidbody” :
- Disable the Use Gravity checkbox
- Enable the Is Kinematic checkbox
Disabling Use Gravity
will make the germ float, and enabling Is Kinematic
will stop bullets (or anything else) from moving it around.
添加碰撞器 Sphere Collider:
In the Center field, set Y to 0.95. This will ensure that the collider sits at the center of the germ, rather than below it.
To change the size of the Collider: set Radius to 1.5
添加一個 名為 Target 腳本組件:
添加動畫和聲音:
將 GermSpike 游戲對象拖拽到 Assets > Creator Kit - FPS > Prefabs > Targets 下面,選擇 Original Prefab,變成預制體:
? Design your Own Level
- Design a full level for the game
- Add locked doors and keys which open them
首先,縮小場景,選中 LevelLayout 游戲對象:
When you do this, blue spheres will appear surrounding the default brain room
執行此操作時,默認的 brain room
周圍將出現藍色spheres
These spheres represent Audio Reverb Zones and Audio Sources, which are components attached to all rooms by default. The spheres can get in the way of editing the level layout, so you’re going to disable them.
這些球體表示音頻混響區域和音頻源,默認情況下,它們是【附加到所有房間的組件】。球體可能會妨礙編輯關卡布局,因此您將禁用
它們。
?? Add New Rooms and Corridors
點擊 Editing Layout,默認情況下,這將啟用“添加”模式。然后單擊 CorridorGroup 添加 Corridors,或單擊 RoomGroup 添加 Rooms。
- corridor /?k??r?d??r/ n. 走廊
然后就可以制作自己的關卡了:
點Remove之后,可以刪除某一段。關卡都制作好后,再次點擊 Editing Layout 退出編輯模式。
保存場景之后運行測試。
?? Add a Locked Door
到 Assets > Creator Kit - FPS > Prefabs > Door and Key 下,選擇 FatBlob ,這個就是門的預制體,拖到場景中:
?? Associate a Key with the Lock
到 Assets > Creator Kit - FPS > Prefabs > Door and Key 下,選擇 Key ,這個就是鑰匙的預制體,拖到場景中
找到Key腳本組件下面 Key Type,設置一個唯一的名稱。
然后選擇 FatBlob 游戲對象 | Lock 腳本 | 選擇開這個門的鑰匙名稱:
保存場景,運行測試看看,獲得鑰匙能否打開門。
? Modify the Doctor’s Weapons
?? Create a New Weapon
到 Assets > Creator Kit - FPS > Prefabs > Weapons 下,選中 GermOBlaster ,cmd + d 復制一份,命名為 Weapon666:
然后編輯 Weapon666 預制體,找到它下面的 Weapon腳本組件(This is a custom script written for this Creator Kit, with lots of different configurable values
.)
- Change the Trigger Type to Manual (現在,當按下扳機時,武器只會發射一次,而不是盡可能快地射擊。)
- Change the Clip Size value from 30 to 8, to reduce the amount of ammo in a single reload clip. ( 將“Clip Size”值從 30 更改為 8,以減少單個裝填彈夾中的彈藥量。)
- Change the Damage value from 0.5 to 5.
?? Make your Weapon Available to the Player
在 Hierarchy 中選擇 Character 游戲對象。找到它下面名為 Controller的腳本組件,然后展開 Starting Weapons :
Change the Size from 3 to 4
. This will give the player four weapons at the start of the level to the player.
Drag the new weapon Prefab from the Project window to the Element 3
field that has appeared in the Inspector.
保存場景,運行。用鼠標滾輪切換武器。
? Create a Level Endpoint
?? Create a LevelEnd GameObject
在 Hierarchy 下 Create Empty ,命名為 LevelEnd。然后 Transform 進行Reset。
按 F 聚焦到 LevelEnd | 添加 Box Collider, 調整size :
把 LevelEnd 放置到合適的位置:
?? Add a Trigger
go to the Box Collider
component. Enable the Is Trigger
checkbox.
Click the Add Component
button. Search for “End Checkpoint
”, and add this component to 【LevelEnd
】.
Save your changes.
Now press Play
and test the trigger, by moving into the Box Collider you placed in the level. When you enter that space, the game will end and show you the result screen
.