摘要: 创建动画片段 修改动画状态机 增加 Attack Layer,把刚才制作好的动画片段加进去 再增加两个变量,bool 类型的 isAttack 和 trigger 类型的 attack New State -> blueAttack1,isAttack = true 并且 attack 触发 blu 阅读全文
posted @ 2024-02-24 15:17 hellozjf 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 添加受伤和死亡动画片段 通过新的层来实现受伤和死亡动画 点击动画控制器右上角的 +,然后新建一个 Layer 注意 Weight 要改成 1,Blending 要改成 Additive 受伤的话,a56爆大奖在线娱乐们通过 hurt 来触发,死亡a56爆大奖在线娱乐们通过 isDead 来控制 在 Hurt Layer 中,当 hur 阅读全文
posted @ 2024-02-24 14:32 hellozjf 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 场景中添加一只野猪 将素材中的野猪图片进行切割,然后给野猪绑定刚体和碰撞体 注意需要两个碰撞体 第一个碰撞体在脚底,避免野猪掉下去,为了避免这个碰撞体和其它敌人以及玩家产生碰撞,需要排除 Player 和 Enemy 层,这样这个碰撞体就只会和平台产生碰撞,避免野猪掉下去 第二个碰撞体a56爆大奖在线娱乐野猪的攻击 阅读全文
posted @ 2024-02-24 13:09 hellozjf 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 动画片段 做成动画片段,命名为 blueCrouchStart 和 blueCrouchIdle 动画状态机 这里a56爆大奖在线娱乐们再接触一个新的东西,Sub-State Machine,可以通过右键 Create Sub-State Machine 来实现 点开 Crouch ,把之前创建好的 blueCrou 阅读全文
posted @ 2024-02-24 12:29 hellozjf 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 人物跳跃的五个阶段 根据这张图把图片切好,并做好动画状态 使用 BlendTree 实现跳跃动画 在动画状态机中新建一个 BlendTree,然后给它添加三个 Motion 因为a56爆大奖在线娱乐设置的 JumpForce 是 5,a56爆大奖在线娱乐人物速度54时候是起跳阶段,41的时候是上升阶段,1~-1的时候是空中换腿阶段, 阅读全文
posted @ 2024-02-24 11:52 hellozjf 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 目标 按住键盘上的 左shift 键,或者手柄上的 左肩键 后,人物行动速度变为原来的 1/5,这样就能够强制走路了 配置 inputControl 实现相关代码 private void Awake() { // 获取 Player 上面的刚体组件 rb = GetComponent<Rigidb 阅读全文
posted @ 2024-02-24 10:51 hellozjf 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 给帧图片命名 添加动画 首先需要给 Player 添加 Animator 组件 然后创建 Animations/Player 文件夹,并在该文件夹下面添加 Animator Controller,起名叫 Player 然后把 Player 拖到 Animator 的 Controller 上面 打开 阅读全文
posted @ 2024-02-24 04:32 hellozjf 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 物理环境监测代码 using System.Collections; using System.Collections.Generic; using UnityEngine; public class PhysicsCheck : MonoBehaviour { [Header("监测参数")] p 阅读全文
posted @ 2024-02-24 03:34 hellozjf 阅读(22) 评论(0) 推荐(0) 编辑
摘要: InputAction 添加跳跃键 代码实现 using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; usi 阅读全文
posted @ 2024-02-24 03:05 hellozjf 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 代码实现 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Scripting.APIUpda 阅读全文
posted @ 2024-02-24 02:21 hellozjf 阅读(24) 评论(0) 推荐(0) 编辑