原创 Unity檢測鼠標是否點擊到某個觸發器

// 射線碰撞體對象 public RaycastHit hit; // 鼠標化身爲射線 Ray myRay = Camera.main.ScreenPointToRay(Input.mousePosition); if(Physic

原创 小地圖功能

新建 camera 小地圖視角,這裏設置 Projection 爲 Orthographic (投影模式爲正交)最好。新建 Render Texture,然後將它拖拽到小地圖Camera的 Target Texture,Texture 能夠

原创 關於在新版本unity學習遇到的坑

當前使用 Unity 版本 2021.3.2f1c1 2022.05.18 1. 在 FixedUpdate 生命週期中,使用 Input 系列函數返回值不正確的問題。 用戶使用空格鍵沒有反應,使用了 Input.GetButtonDown