Microsoft PowerPoint - Test.ppt

Similar documents
Microsoft PowerPoint 龍華科技大學遊戲系-Unity teaching

Microsoft PowerPoint - Unity3d_Input

入 指 令 如 : 鍵 盤 鼠 標 多 點 觸 控 重 力 感 應 陀 螺 儀 等 4. 圖 形 用 戶 接 口 掌 握 引 擎 API 中 GUI 與 GUILayout 類 中 方 法 和 變 量 的 使 用, 能 夠 通 過 GUI Skin 為 應 用 的 界 面 定 制 不 同 風 格 主

摘 要 本 校 多 媒 體 設 計 系 與 上 海 戲 劇 學 院 創 意 學 院 在 多 次 聯 繫 交 流 之 下, 已 簽 署 合 作 備 忘 錄, 積 極 尋 求 兩 校 合 作 教 學 與 共 同 創 作 之 機 會 藉 由 本 系 學 生 作 品 腦 殘 公 寓 入 圍 第 五 屆 中

Step03 首先先將基礎場景必需物建置完成 新增一個基礎方塊,GameObject > Create Other > Cube: Step04 設置位置至 (0, 0, 0), 並調整大小為 (50, 1, 50): 2

2D Asset Demo Rain Snow SteamSpray VolumeSteam Waterfall Demo Unity Asset store 7.3 2D example\practice\ch07 Unity ch07 MissileExplosion Wall 7-8

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2

Microsoft PowerPoint - 00_SimplePlatform

崑山科技大學

建 立 一 面 牆 以 下 說 明 將 會 講 解 比 較 利 用 預 設 物 件 (using a Prefab) 和 從 編 碼 來 創 立 物 件 (creating objects from code) 兩 者 間 的 優 點 首 先, 我 們 用 編 碼 來 建 立 一 面 牆 : fun

untitled

透 過 選 擇 Google Street View 場 景 模 式 來 呈 現 實 際 道 路 上 的 狀 況 模 擬 並 且 經 由 預 先 紀 錄 好 的 各 國 都 市 座 標, 讓 使 用 者 可 以 選 擇 各 國 道 路 來 做 行 車 上 的 模 擬 使 本 系 統 不 僅 可 以

Project 1.Demo public Renderer trackl; public Renderer trackr; public float trackspeed = 0.02f; 6-29


untitled

untitled

2

7. 小 星 星 一 閃 一 閃 亮 晶 晶, 滿 天 都 是 小 星 星 ; 掛 在 天 空 放 光 明, 好 像 許 多 小 眼 睛 ; 一 閃 一 閃 亮 晶 晶, 滿 天 都 是 小 星 星

Microsoft Word - FPKLSC_21.docx

四川省普通高等学校

Microsoft PowerPoint - ATF2015.ppt [相容模式]

Microsoft PowerPoint - OPVB1基本VB.ppt


<4D F736F F D B0EABB79A4E5B8D5C344BBBCB065AAA9>


康體藝術

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

void Start () Fire = 0; Fire -= 1 * Time.deltaTime; Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition); // 宣告射線 RaycastHit hit; // 射線撞擊 if (

Microsoft Word - 中耳的主要疾病~中耳炎.doc

彩圖 6 彩圖 7 彩圖 8 3

3-1 Wii ( )

AM101-1(中文)11.cdr


上海浦~1

<4D F736F F D203131B24DA448C1F5AED1AABAC2E0A4C6BB50B942A5CE2E646F63>

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2

Adobe® Flash® 的 Adobe® ActionScript® 3.0 程式設計

2 黑 色 皇 后 兵 向 前 移 動 兩 格 3 白 色 主 教 兵 4 黑 色 皇 后 對 角 移 動 到 對 吃 掉 白 色 國 王 的 位 置 在 這 個 章 節 中 你 會 學 到 1 打 開 設 定 關 鍵 (Set Key) 模 式 2 使 用 在 檢 視 軌 跡 中 的 可 設 定

Microsoft Word - C-pgm-ws2010.doc

考 纲 解 读 14 浙 江 省 普 通 高 考 语 文 科 考 纲 研 读 吴 美 琴 今 年 的 考 试 说 明, 我 用 了 八 个 字 进 行 概 括, 那 就 是 稳 中 微 调, 关 注 生 活 稳 中 微 调 :14 年 的 语 文 考 试 说 明 是 近 几 年 来 调 整 幅 度

Microsoft PowerPoint - 08網路遊戲犯罪.ppt

C/C++语言 - C/C++数据

PowerPoint Presentation

Microsoft Word - CH07_分子特效應用.doc

目 錄 1 序 論 遊 戲 設 計 背 景 與 動 機 設 計 目 的 系 統 功 能 2 2 開 發 環 境 Unity3D Adobe PhotoShop CS Unity 簡 單 操 作 3 3 問 題 與 解 決 辦

Ladder_2004.doc

SDP

甄選入學howhow作印刷校過版

影視後製全攻略 Premiere Pro After Effects Encore 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS Adobe CS5 Adobe CS4 Premiere Pro After Effect

三維空間之機械手臂虛擬實境模擬

PhotonCloud課程(二)

<img>

Ps22Pdf

Présentation PowerPoint

KDC-U5049 KDC-U4049 Made for ipod, and Made for iphone mean that an electronic accessory has been designed to connect specifically to ipod, or iphone,

5. 閱 讀 下 文, 推 斷 內 最 適 合 填 入 的 詞 語 依 序 為 何? 人 也 真 是 一 個 絕 字, 一 邊 向 左, 一 邊 向 右, 一 副 的 樣 子, 偏 又 相 連 著, 各 說 各 話 各 走 各 路, 卻 又 人, 這 麼 一 個 簡 單 的 字, 竟 包 含 如 此

Microsoft Word - 新增Microsoft Word 文件.doc

2 坐 标 表 示 2 % 第 一 种 方 式 \tikz \draw (0,0) -- (1,1); % 第 二 种 方 式 \tikz{\draw (0,0) -- (1,1); \draw (0,1) -- (1,0);} % 第 三 种 方 式 \draw (0,0) -- (1,1); \

K301Q-D VRT中英文说明书141009

MATLAB 1

3. 反 映 : 4. 五 花 八 门 : 5. 慷 慨 : 6. 参 与 : 7. 慰 劳 : 8. 延 续 : 9. 珍 爱 : 10. 浪 漫 : 三. 找 出 下 列 每 组 词 中 的 近 义 词 或 同 义 词 : 节 日 节 气 节 令 时 节 习 俗 民 俗 仪 式 风 俗 文 献

Primary Mathematics Catalogue(for schools) as at xls

untitled

TI 3 TI TABLE 4 RANDBIN Research of Modern Basic Education

第 6. 節 不 定 積 分 的 基 本 公 式 我 們 可 以 把 已 經 知 道 反 導 函 數 之 所 有 函 數 都 視 為 不 定 積 分 的 基 本 公 式 基 本 公 式 涵 蓋 的 範 圍 愈 大, 我 們 求 解 積 分 就 愈 容 易, 但 有 記 憶 不 易 的 情 事 研 讀

IC-900W Wireless Pan & Tilt Wireless Pan & Tilt Remote Control / Night Vision FCC ID:RUJ-LR802UWG

甄試報告1125.PDF

840 提示 Excel - Excel -- Excel (=) Excel ch0.xlsx H5 =D5+E5+F5+G5 (=) = - Excel 00

chapter 2 HTML5 目錄iii HTML HTML HTML HTML HTML canvas

Transcription:

Unity 常用指令 龍華科技大學多媒體與遊戲發展科學系 林志勇編輯, 請勿外流轉載, 上傳網路

範例用到的指令 function Update function OnGUI GUI.Button GUI.HorizontalSlider; function OnCollisionEnter Input.GetKeyUp gameobject.find transform.rotate transform.translate transform.position transform.position.z transform.eulerangles Vector3 gameobject.find( GUI Text ). guitext.text transform.rigidbody.usegravity transform.rigidbody.velocity transform. rigidbody.iskinematic var cube=instantiate(cube,vector3(0,y,x),quaternion.identity); particleemitter.emit = true;

遊戲物件 (GameObject)

增加元件 (AddComponent) 移除元件 (RemoveComponent)

腳本參考 (Scripting Reference)

行為 (Mono Behavior) 每個 Frame 都執行一次 function Update () { } 當 Update 被呼叫後, 執行 LateUpdate 通常用在 Camera 設定上 function LateUpdate () { } 在某些固定 Frame 被呼叫通常用在 Rigidbody 設定上 function FixedUpdate () { }

行為 (Mono Behavior) 在 Script 初始化時執行 function Awake () { } 在 Awake 後執行 function Start () { } 每個 Frame 都執行一次, 只用在 GUI function OnGUI () { }

function OnMouse ( 滑鼠 ) ( 參考 021) function OnMouseEnter (){} function OnMouseOver (){} function OnMouseExit (){} function OnMouseDown (){} function OnMouseUp (){}

function OnTrigger ( 觸發 ) ( 參考 025) function OnTriggerEnter (other : Collider ){} function OnTriggerExit (other : Collider ){} function OnTriggerStay (other : Collider ){}

function OnCollision( 碰撞 ) ( 參考 057) function OnCollisionEnter(collisionInfo : Collision){ } function OnCollisionStay(collisionInfo : Collision) { } function OnCollisionExit(collisionInfo : Collision) { }

GUI( 參考 U5) 按鈕 :GUI.Button function OnGUI () { if (GUI.Button (Rect (10,10,150,100), "I am a button")) { } } 水平滑軌 : GUI.HorizontalSlider var hs : float; hs = GUI.HorizontalSlider (Rect (25, 25, 100, 30), hs, 0.0, 10.0); 切換 : GUI.Toggle var togglebool = true; togglebool = GUI.Toggle (Rect (25, 25, 100, 30), togglebool, "Toggle");

偵測輸入 ( 參考 U7) 鍵盤 :Input.GetKeyUp( up ) 滑鼠 :Input.GetMouseButtonDown(0) 通常放在 function Update(){ Input.GetKeyUp( up ) }

找尋遊戲物件 gameobject.find( Cube ) 程式放在 Cube transform.rotate(10,10,10) 程式不放在 Cube 上 ( 例如放在 Camera) gameobject.find( Cube ). transform.rotate(10,10,10)

找尋遊戲物件標籤 (Tag) gameobject.findwithtag ("Player").

顯示數字資料 (GUIText) var i : int; gameobject.find( GUI Text ). guitext.text=i.tostring(); 轉字串函數 :ToString()

控制遊戲物件 (transform) ( 參考 U6) 旋轉 :transform.rotate(10,10,10) 移動 :transform.translate(10,10,10) 位置 :transform.position=vector3(1,1,1) 位置 :transform.position.z=1; 角度 :transform.eulerangles=vector3(1,1,1) 向量 :Vector3

剛體 (rigidbody) ( 參考 B00) 使用重力 : transform.rigidbody.usegravity=true 剛體速度 : transform.rigidbody.velocity=vector3(1,1,1) 不被物理性質影響 : transform. rigidbody.iskinematic = true 加力量 transform. rigidbody.addforce (0, 10, 0) 加扭矩 transform. rigidbody.addtorque (0, 10, 0)

增加物理材料 (Physic Materials) 彈性 (Bouncy)

複製物件 ( 參考 088, 085) var cube=instantiate(cube,vector3(0,y,x),quaternion.identity);

燈光 ( 參考 U3) 投射光角度 light.spotangle = 10 燈光強度 light.intensity =1 燈光範圍 light.range =10

renderer.enabled 使 3D 物件看的見 transform.renderer.enabled=true; 隱藏 3D 物件 transform.renderer.enabled=false;

增加資源 (Assets)

觸發分子系統 分子系統 (Particles) ( 參考 078) particleemitter.emit = true; yield WaitForSeconds(1); particleemitter.emit = false;

分子系統 (Particles)

Application( 參考 043) 切換關卡 Application.LoadLevel(0) 列印目前載入關卡編號 print(application.loadedlevel); 離開程式 Application.Quit();

動畫 (Animation) ( 參考 U15) animation.play() animation.stop() animation.wrapmode = WrapMode.Loop;

圖片 ( 參考 122) gameobject.find("guitexture").guitexture.te xture=resources.load(i.tostring());

影片 ( 參考 046) // Assigns a movie texture to the current transform, plays it // and when the user presses the *space* key, stops the video. var movtexture : MovieTexture; function Start () { renderer.material.maintexture = movtexture; movtexture.play(); } function Update() { if(input.getkeydown(keycode.space)) movtexture.stop(); }

聲音 (audio)( 參考 005) var myclip : AudioClip; function Start (){ audio.playoneshot(myclip); } audio.play(); audio.stop(); // Delay a clip by 1 sec (44100 samples) audio.play(44100); audio.pause();

數學 (Mathf) Abs Approximately Ceil CeilToInt Clamp Clamp01

數學 (Mathf) Sin Cos Tan PI Asin Acos Atan Atan2 Deg2Rad Rad2Deg DeltaAngle

數學 (Mathf) ClosestPowerOfTwo IsPowerOfTwo NextPowerOfTwo Pow Exp Floor FloorToInt Infinity NegativeInfinity Epsilon Log Log10

數學 (Mathf) Lerp InverseLerp LerpAngle MoveTowards MoveTowardsAngle Max Min

數學 (Mathf) PingPong Repeat Round RoundToInt Sign

數學 (Mathf) SmoothStep SmoothDamp SmoothDampAngle Sqrt

傳值 ( 參考 028) PlayerPrefs.SetInt("Player Score", 10); print (PlayerPrefs.GetInt("Player Score")); PlayerPrefs.SetFloat("Player Score", 10.0); print (PlayerPrefs.GetFloat("Player Score")); PlayerPrefs.SetString("Player Name", "Foobar"); print (PlayerPrefs.GetString("Player Name")); PlayerPrefs.Save()

計算時間 ( 參考 U11) Time.time

007_ 計分 長條狀的 GUI

008_Clock( 計分 圓形 )