Unity Learning for Day 25
2017-06-25 22:01
465 查看
1、主角移动
2、摄像机移动
3、C#语法基础
4、C#面向对象基础
5、MVC简介
MVC 是软件开发行业比较经典的设计模式, 是一种代码开发的思想和套路。将要实现的某个功能分成三个部分:
V: View[视图层], 也就是界面, 主要负责和用户进行输入输出的交互;
C: Controller[控制器层], 负责处理该功能的逻辑部分;
M: Model[模型层], 主要对数据进行操作;
6、C#数据结构基础
7、刚体触发事件的监测与处理
触发器
将碰撞体组件属性面板上的“Is Trigger” 选项选中, 当前的游戏物体的碰撞体就变成了触发器。移动的刚体物体会穿透碰撞体勾选了“Is Trigger” 的物体。
触发事件
当一个用刚体控制的物体进入到另外一个物体的触发器范围内, 就是触发事件。触发用途: 不与目标物体发生直接的碰撞(接触), 而是只要进入目标物体的“触发范围” 就能执行某些特定操作。
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float speed = 5f; // Use this for initialization void Start () { } // Update is called once per frame void Update () { Vector3 movement = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0f); transform.position += movement * speed * Time.deltaTime; } }
2、摄像机移动
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraController : MonoBehaviour { PlayerController player; public bool follow = true; // Use this for initialization void Start() { player = FindObjectOfType<PlayerController>(); } // Update is called once per frame void LateUpdate() { if (player != null && follow) transform.position = player.transform.position + new Vector3(0f, 0f, -10f); } }
3、C#语法基础
4、C#面向对象基础
5、MVC简介
MVC 是软件开发行业比较经典的设计模式, 是一种代码开发的思想和套路。将要实现的某个功能分成三个部分:
V: View[视图层], 也就是界面, 主要负责和用户进行输入输出的交互;
C: Controller[控制器层], 负责处理该功能的逻辑部分;
M: Model[模型层], 主要对数据进行操作;
6、C#数据结构基础
7、刚体触发事件的监测与处理
触发器
将碰撞体组件属性面板上的“Is Trigger” 选项选中, 当前的游戏物体的碰撞体就变成了触发器。移动的刚体物体会穿透碰撞体勾选了“Is Trigger” 的物体。
触发事件
当一个用刚体控制的物体进入到另外一个物体的触发器范围内, 就是触发事件。触发用途: 不与目标物体发生直接的碰撞(接触), 而是只要进入目标物体的“触发范围” 就能执行某些特定操作。
相关文章推荐
- Unity Learning for Day 2
- Unity Learning for Day 6
- Unity Learning for Day 17
- Unity Learning for Day 22
- Unity Learning for Day 3
- Unity Learning for Day 20
- Unity Learning for Day 15
- Unity Learning for Day 12
- Unity Learning for Day 19
- Unity Learning for Day 26
- Unity Learning for Day 24
- Unity Learning for Day 5
- Unity Learning for Day 14
- Unity Learning for Day 21
- Unity Learning for Day 9
- Unity Learning for Day 26
- Unity Learning for Day 16
- Minigame Learning for Day 8
- Ending Learning for Day 11
- Minigame Learning for Day 2