摘要: 使用 Addressable 如下图所示安装 Addressables 打开 Addressables 创建 Addressables Settings 创建完毕之后,就能在 Assets 目录下找到配置好的文件 a56爆大奖在线娱乐们把默认的 Group Name 改成 Scenes 然后选择场景,勾选 Addre 阅读全文
posted @ 2024-02-28 14:15 hellozjf 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 创建可互动接口 实现宝箱代码 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Chest : MonoBehaviour, IInteractable { priv 阅读全文
posted @ 2024-02-28 12:55 hellozjf 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 场景中叠加场景 将两个场景的公用部分提取到 Persistent 场景中,之后需要使用哪个场景,只需要把那个场景添加到 Persistent 场景下面就行了 注意,如果要往场景中添加物体的话,需要先把场景激活 添加宝箱 先切割宝箱图片,然后把宝箱放到场景中,给宝箱添加 Box Collider 2D 阅读全文
posted @ 2024-02-28 11:59 hellozjf 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 修改场景中的 Grid 它们都要有 Tilemap Collider 2D 组件,并且 Is Trigger 为 true 给 水 添加 Water 标签 人物碰到水就死亡 修改 Character.cs,增加 OnTriggerStay2D 方法 添加荆棘 然后再给荆棘添加 Attack 组件 项 阅读全文
posted @ 2024-02-28 11:36 hellozjf 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 免费音乐和音效 音效:https://assetstore.unity.com/packages/audio/sound-fx/free-casual-game-sfx-pack-54116 音乐:https://assetstore.unity.com/packages/audio/music/f 阅读全文
posted @ 2024-02-27 15:19 hellozjf 阅读(19) 评论(0) 推荐(0) 编辑
摘要: Cinemachine 安装 cinemachine 添加 cinemachine 添加完之后,需要将 Player 作为 Cinemachine 的 Follow 对象 之后摄像机默认就能跟随玩家了,a56爆大奖在线娱乐们还可以调整一些参数 通过设置 Dead Zone 给摄像机一个缓冲值,中心点没有离开缓冲区域的 阅读全文
posted @ 2024-02-27 14:08 hellozjf 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 动画 a56爆大奖在线娱乐们需要快速打断滑铲,a56爆大奖在线娱乐没用结束滑铲 动画状态机中,使用了 isSlide 这个布尔变量 New State -> blueSlide0,需要 isSlide = true,立即进入 blueSlide0 -> blueSilde1,需要 isSlide = true,完整播放一次之后进入 阅读全文
posted @ 2024-02-26 22:11 hellozjf 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 滑墙的实现方式 动画 使用滑墙图片制作滑墙动画,只有一帧的动画 动画状态机中,增加了 onWall 这个 bool 变量,以及 blueWallSlide 这个状态 当 onWall == true 时,从 Jump 立即切换到 blueWallSlide 当 onWall == false && 阅读全文
posted @ 2024-02-26 20:41 hellozjf 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 使用 ScriptableObject 实现血量更新 创建 ScriptableObject 内容如下 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.E 阅读全文
posted @ 2024-02-26 15:42 hellozjf 阅读(43) 评论(0) 推荐(0) 编辑
摘要: Colourful Hierarchy Category GameObject 插件 用于美化 Hierachy 窗口 通过查看 Color Palette 可以知道用法 UI InputSystem 冲突 a56爆大奖在线娱乐们的项目使用了最新的 Input System,a56爆大奖在线娱乐需要按上图所示进行操作,以便 UI 也 阅读全文
posted @ 2024-02-26 14:50 hellozjf 阅读(39) 评论(0) 推荐(0) 编辑