Part 0. 傅老師Unity基礎(chǔ)課

以下傅老師的Unity基礎(chǔ)課程超級(jí)簡單版筆記
順便安利一下傅老師,聲音超像周董的!人也很幽默,超喜歡的嘿嘿(?>?<)☆
鏈接附上感興趣就康康吧~

視窗

Toolbar 工作列
Hierarchy 樹狀圖
SceneView 3D工作區(qū)/關(guān)卡編輯器
Inspector 參數(shù)
Project 資源管理器

移動(dòng)

1. 移動(dòng)自己
  • Fly mode: RMB(right mouse button) + WASDQE
  • lock rotate(focus):F => alt + LMB
  • create => 3D object =>cube
    -復(fù)制物件 => ctrl + d
2. 移動(dòng)別人

原形(primatives)

  1. Cube
  2. Sphere 球體
  3. Quad 四邊形(4)
    Plan 平面(>4)
  4. Cylinder 圓柱體
  5. Capsule 膠囊

材質(zhì)球(material)

  • Albedo(反射率 ≠ defuse): Texture
  • Tiling(瓷磚): 重復(fù)次數(shù)
  • Offset: 偏移量
  • Metalic: 有跟沒有金屬?(天空盒有關(guān))
  • Smoothness: 光滑(天空盒有關(guān))
  • 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 () {
        //一次性程式區(qū)
        //print(name);

    }
    
    // Update is called once per frame
    void Update () {
       //重復(fù)性程式區(qū) 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)
Collider Manual Part1.
Collider Manual Part2.

FINISH 2020-3-5

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容