随笔分类 - ⑧ 项目学习
摘要:标签增加: 1、home:家,用来触发失败 2、tank:坦克 3、enemy:敌人 4、wall:墙 5、barrier:障碍 触发器:注意使用2d触发器就要使用2D触发器的方法,不然不会触发 3D触发器:OnTriggerEnter、OnTriggerExit、OnTriggerStay 2D触发器:OnTriggerEnter2D、OnTriggerExit2D、OnTriggerSt...
阅读全文
摘要:2D游戏UI和3D游戏UI是相反的(以轴作参照) using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { #region 属性值 public float moveSpeed;//坦克移动速度 ...
阅读全文
摘要:using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { #region 属性值 public float moveSpeed;//坦克移动速度 #endregion #region 引用值...
阅读全文
摘要:bug修改: 1、上下移动和左右移动同时存在时,坦克会斜着移动 解决:增加移动优先级 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { public float moveSpeed;//坦克移动速度 ...
阅读全文
摘要:两个发生碰撞的物体都要有碰撞器,其中一个要有刚体(最好是运动的一方) 刚体会休眠:经常性不运动,刚体会休眠,休眠以后就不会发生碰撞检测 碰撞器: 1、3D碰撞器 2、2D碰撞器 主角Player增加Rigidbody2和BoxCollider2D,修改GravityScale为0,主角就不会掉下去了 地图物体增加BoxCollider2D bug修改: 1、当坦克挂到地图物体是发生...
阅读全文
摘要:两种方式: 1、图片切换 2、图片旋转 1、图片切换方式: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { public float moveSpeed;//坦克移动速度 private S...
阅读全文
摘要:创建Player脚本: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { public float moveSpeed;//坦克移动速度 void Start () { ...
阅读全文
摘要:1、Unity开发以米为单位 创建Cube作为参照 2、创建预制体:从project项目管理器拖sprite到Hierarchy管理器 3、创建动画:一起拖
阅读全文
摘要:1、摄像机设置: Clear Flages:选择Solid Color BackGround:选择黑色 Projection:选择Trthographic Size:填5 2、窗口选择5:4 3、图片类型选择:Sprite(2D and UI) SpriteMode:选择Multiple Automatic:自动 GridByCellSize:固定大小格 GridByCellCou...
阅读全文

浙公网安备 33010602011771号