Unity 3D學習日記(6)

2021-08-08 04:45:19 字數 1203 閱讀 7201

2.第一人稱控制器 character controller

slope limit 坡度限制

step offset 台階高度

skin width 兩個碰撞物體可以互相滲透的深度 大:顫抖 小:卡 等於半徑的10%

min move distance 最小移動距離 一般為0

center

radius 碰撞器半徑

height 碰撞器高度

3.input.getaxis(「mouse x」)(左右方向)

4.mesh renderer 網格

materials 材質

5.子級物體隨父級運動

6.陰影設定 directional light-shadow type

7.第三人稱控制器

8.主攝像機 camera

clear flags 螢幕空白部分影象

culling mask 遮蔽

projection 投影方式

clipping planes 剪下平面

depth 優先順序

9.規範化視窗檢視viewpot rect 攝像機檢視的位置與大小

第二個攝像機分屏 畫中畫效果(改depth)

螢幕左下角(0,0)右上角(1,1)

10.指令碼基礎

變數 變數名不可與unity3d自帶元件重複

公有變數 可被其他指令碼引用 可在檢視面板中顯示

11.vector3 資料型別 可儲存x,y,z座標系資料的簡單資料型別

vector3.forward

vector3.up

vector3.zero

vector3.one

public float speed=5.0f

public vector3 v;

v= [new] vector3(0,0,speed);

12.rigidbody.velocity 初速度

gameobject.getcomponent().velocity=vector3

13.滑鼠指向函式void onmouseover()

onmouseexit()

onmousedown()

14.旋轉 transform.rotate(x,y,z)

15.boolean x=false;

if(x)

else

Unity 3D學習日記(2)

1.例項化用instantiate 要生成的物體,生成的位置,旋轉角度 2.檢測滑鼠左鍵並生成物體 if input.getbuttondown fire1 3.給物體加力 n.rigibody.addforce fwd 28000 4.轉換方向 vector3代表xyz vector3 fwd t...

Unity3d學習日記(六)

public static texture2d getmodifiedtexture2d texture2d source,int newwidth,int newheight,float alpha return re 用的話就像下面這樣呼叫就行了,s是縮放大小,a是透明度 var texture...

Unity3D 學習教程 6 基本操作

開啟檔案 新建乙個場景 開啟乙個場景 儲存場景 新建乙個專案 專案可以包含多個場景 open是開啟專案 儲存專案 這個很重要 把程式輸出成 應用程式 還是web程式 或手機程式 還有ps2程式 下面詳細介紹 unity3d 可以輸出各種應用 非常方便 520520 520 520 5200 5200...