随笔分类 - C#
摘要:取消手枪自动播放动画 using System.Collections; using System.Collections.Generic; using UnityEngine; public class GunManager : MonoBehaviour { //1.枪旋转角度 xy轴轩轩角度
阅读全文
摘要:每隔一秒点击鼠标左键发射子弹 创建球体(子弹)调整位置和大小 创建子弹材质 得到子弹生成位置 复制一份子弹,删掉多余属性 放到枪下面 把Bullet做成预制体 拖放 隐藏子弹 得到子弹和位置 public GameObject bulletGO; public Transform firePosit
阅读全文
摘要:新建脚本文档 要达到鼠标控制手枪的旋转 确定枪的旋转角度 using System.Collections; using System.Collections.Generic; using UnityEngine; public class GunManager : MonoBehaviour {
阅读全文
摘要:使激活状态的怪变为未激活状态 private void DeActiveMonster() { if (activeMonster != null) { activeMonster.GetComponent<BoxCollider>().enabled = false; activeMonster.
阅读全文
摘要:分析 九个坑位要随机生成怪物,随机时间生成 类似打地鼠 协程(Coroutines) 协程:协程是一个分部执行,遇到条件(yield return语句)时会挂起,直到条件满足时才会被唤醒继续执行后面的代码。 IEnumerator AliveTimer() { yield return new Wa
阅读全文
摘要:对target创建脚本 逻辑梳理 控制目标显示与隐藏 控制被射击 是否显示死亡动画 创建怪物数组 using System.Collections; using System.Collections.Generic; using UnityEngine; public class TargetMan
阅读全文
摘要:第一部分:游戏基本功能的实现(场景的搭建、协程的使用、碰撞器、UGUI) 第二部分:游戏的存档与读档的实现(PlayerPrefs、XML、JSON) 1.搭建场景1 找到图片后右键此处可初始化 翻转 第一个位置 复制墙体 调整每一个间隔 创建空物体 将空物体位置归零 将上一步的四个墙体放入空物体中
阅读全文

浙公网安备 33010602011771号