以下傅老师的Unity基础课程超级简单版笔记
顺便安利一下傅老师,声音超像周董的!人也很幽默,超喜欢的嘿嘿(๑>ڡ<)☆
链接附上感兴趣就康康吧~
视窗
Toolbar 工作列
Hierarchy 树状图
SceneView 3D工作区/关卡编辑器
Inspector 参数
Project 资源管理器
移动
1. 移动自己
- Fly mode: RMB(right mouse button) + WASDQE
- lock rotate(focus):F => alt + LMB
- create => 3D object =>cube
-复制物件 => ctrl + d
2. 移动别人
原形(primatives)
- Cube
- Sphere 球体
- Quad 四边形(4)
Plan 平面(>4) - Cylinder 圆柱体
- Capsule 胶囊
材质球(material)
- Albedo(反射率 ≠ defuse): Texture
- Tiling(瓷砖): 重复次数
- Offset: 偏移量
- Metalic: 有跟没有金属?(天空盒有关)
- Smoothness: 光滑(天空盒有关)
- Normal: 法向量贴图 (pbr material)
Based Coding
- 滑杆
[Range(1,15)]
public float z;
- 初始
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour {
//Variables
public int x;
public float y;
[Range(1, 15)]
public float z;
public string name;
// Use this for initialization
void Start () {
//一次性程式区
//print(name);
}
// Update is called once per frame
void Update () {
//重复性程式区 60次/s
print(gameObject.transform.position.x);
}
}
- 桌面显示插件
void OnGUI()
{
GUI.Box(new Rect(Screen.width - 260,10,250,50),"Interaction");
GUI.Label(new Rect(Screen.width - 245, 30, 250, 30), "Up/Down Arrow : Go Forward/Go Back");
}
- 控制门上下
public class IronBar : MonoBehaviour {
public float startY;
// Use this for initialization
void Start () {
startY = transform.position.y; //save the initial position of bar
}
// Update is called once per frame
void Update () {
//print(gameObject.transform.position.x);
//put E bar UP/put Q bar Down
if(Input.GetKey(KeyCode.E))
{
if (transform.position.y <= (startY + 2.5f))
{
transform.position = new Vector3(transform.position.x, transform.position.y + 0.1f, transform.position.z);
}
}
else if (Input.GetKey(KeyCode.Q))
{
if (transform.position.y >= startY)
{
transform.position = new Vector3(transform.position.x, transform.position.y - 0.1f, transform.position.z);
}
}
}
- 开门按钮碰撞
//不勾选Is Trigger
private void OnCollisionEnter(Collision cllision)
{
print("collision enter");
}
//勾选Is Trigger
private void OnTriggerEnter(Collider other)
{
print("trigger enter");
}
- 《Learning Physics Modeling with PhysX》
世界三大物理引擎(PhysX、Havok、Bullet)
FINISH 2020-3-5