Unity Creator Kit: Puzzle

2023-12-30  本文已影响0人  我阿郑

Creator Kit: Puzzle 资源地址

✅ Get Started with the Creator Kit: Puzzle

新建Unity项目3D | 版本选择 2022.3 或更高 | 导入Creator Kit: Puzzle资源 | 双击 ExampleMenu :

image.png

点play 按钮运行起来:

image.png

✅ Design a Simple Puzzle

In this Creator Kit, you’ll use connectable puzzle pieces to build tracks which are used to guide a marble to a goal. In this tutorial, you’ll:

您将使用可连接的拼图来构建轨道,用于引导弹珠到达目标。

How to Use the 【Menu】 and 【Level System

➡️ Create a Menu: 顶部菜单 Puzzle Kit Tools > Create Menu:

image.png

点击 Create Menu,就会在这个路径下生成一个新的名为 newMenu 的Scene:

image.png

双击 newMenu 打开场景 | 选中MenuCanvas | 找到它身上的 Scene Menu 脚本:

image.png

设置第一关。
点击Create and Add 按钮 create a new level。

image.png

This will create a default level linked to the menu, which you can customize.

image.png

最后,为三个“Star Time”字段选择时间(以秒为单位)。玩家完成关卡的速度越快,他们应该获得的星星就越多:你的Three Star Time 应该具有最低值,One Star Time 应该具有最高值。

➡️ Open the Layout Editing System

在 Project窗口下,双击刚刚创建的 newLevel 场景:

image.png

select the LevelLayout GameObject | find the PuzzleLayout component

image.png

This will enable you to choose puzzle pieces to use in your level and snap them together.
这将使您能够选择要在关卡中使用的puzzle pieces并将它们组合在一起。

Click the Editing Layout button:

image.png
  1. Click the StraightRampPieces box button. This will show all the straight ramp pieces available to you. 这将显示所有可用的【直坡道】。
  2. Select the sloping straight piece — starting with a slope will help get the marble rolling. 选择倾斜的笔直部分——从斜坡开始将有助于使弹珠滚动。
marble
n. 大理石
(用玻璃、泥等制成的)弹子
弹子游戏

Click in the Scene view to add the piece as a child of the LevelLayout GameObject.

image.png

When you’ve finished adding ramp pieces, click the Editing Layout button again to turn off editing mode. Remember to save your changes! 记得退出编辑模式

As you add more puzzle pieces, especially curved ramps, you may want to change the orientation of a piece. You can use the Flip field buttons to:

image.png

You can also press 【R】 to change the connector the piece will use to snap to the next one.

➡️ Position the Marble and Goal

select the Marble GameObject.

If the Marble GameObject is not properly aligned to the start of the puzzle, drag on these arrows to move it.
如果 Marble 游戏对象未正确与puzzle的开头对齐,请拖动这些箭头以移动它。

image.png

select the Goal GameObject

Repeat the process to center the view on the Goal, and move it to the end of your puzzle.

image.png

Now you can test the puzzle — click Play in the toolbar to begin. If you get stuck, you can restart the level by pressing the R key.

现在您可以测试puzzle了 —— 在工具栏中点击“播放”开始游戏。如果您卡住了,可以通过按下R键来重新开始该关卡。

✅ Increase the Challenge

In this tutorial, you’ll:

➡️ Add More 【Prefab Objects】

Assets/Creator Kit - Puzzle/Prefabs/PuzzlePieces 下找到 InteractivePuzzlePieces ,把它下面的 Spoon 拖拽到场景中:

image.png

选中 Spoon 游戏对象,找到它下面的脚本组件:Flipper。

You can add as many InteractivePuzzlePieces to your level as you like.

You can also add OtherPuzzlePieces using the same drag and drop process. These pieces don’t need any input from the player.

image.png

➡️ Create Another 【Marble】

You can also add multiple marbles to your levels to create more imaginative puzzles. 您还可以在关卡中添加多个弹珠,以创建更具想象力的谜题。

找到 Assets/Creator Kit - Puzzle/Prefabs/OnePerLevel

image.png

可以在拖拽1个 Marble到场景中,命名为 Marble2:

image.png

To make sure that the Camera can follow different marbles in your level:

image.png image.png

Save your changes.

➡️ Start the Level with a Different Marble

When you click Play, the initial marble in the level is frozen in space until the level has finished fading in, at which point the timer starts. If you want your new marble to be the one that starts the game, you need to adjust the Timing GameObject

单击“播放”时,关卡中的初始弹珠将冻结在空间中,直到关卡完成淡入,此时计时器将启动。如果希望新弹珠成为游戏的启动对象,则需要调整 Timing 游戏对象:

image.png image.png

TIP: You can also use the Timing Recording component to change the key used to 【restart the game】, by selecting a new key in the Reset Key Code field. 可以修改重新启动游戏的Key

➡️ Finish the Level with a Different Marble

If you want your new marble to be the one that triggers level completion, you also need to change the Goal settings:

image.png

➡️ Add Multiple Puzzle Layouts to your Level

If you want to really create a challenge, you can also add multiple puzzles to one level. This can be useful if you want to play with 【more advanced designs】. 更高级的设计

Note: As you’ve previously explored, only assigned marbles can start or end the level. If you are using multiple puzzle layouts in one level, check carefully to make sure you have assigned these roles correctly or you may have difficulty playing the level.
正如您之前所探索的,只有指定的弹珠才能开始或结束关卡。如果您在一个关卡中使用多个puzzle布局,请仔细检查以确保您正确分配了这些角色,否则您可能难以玩该关卡。

To add multiple puzzle layouts to your level:

image.png
上一篇 下一篇

猜你喜欢

热点阅读